-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathparse.php
More file actions
29 lines (23 loc) · 780 Bytes
/
Copy pathparse.php
File metadata and controls
29 lines (23 loc) · 780 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
// https://www.vnil.cn开发者后台生成的appkey
$appkey = '';
//需要解析的url
$url = '';
$param = [
'appkey' => $appkey,
'url' => $url,
];
//得到请求的地址:https://api.vnil.cn/api/parse/deal?appkey=appkey&url=url
$apiUrl = 'https://api.vnil.cn/api/parse/deal?'.http_build_query($param);
$ch = curl_init();
curl_setopt ( $ch, CURLOPT_URL, $apiUrl );
curl_setopt ( $ch, CURLOPT_SSL_VERIFYPEER, FALSE );
curl_setopt ( $ch, CURLOPT_SSL_VERIFYPEER, 0 );
curl_setopt ( $ch, CURLOPT_SSL_VERIFYHOST, 0 );
curl_setopt ( $ch, CURLOPT_MAXREDIRS, 5 );
curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt ( $ch, CURLOPT_FOLLOWLOCATION, 1 );
curl_setopt ( $ch, CURLOPT_TIMEOUT, 10 );
$content = curl_exec( $ch );
curl_close ( $ch);
print_r($content);