public function index2()
{
$urls = array(
'http://www.xxxxxxx.com.cn/stock.php/index',
'http://www.xxxxxxx.com.cn/stock.php/index/Blog/wen2019121501',
'http://www.xxxxxxx.com.cn/stock.php/index/Blog/wen2019122101',
);
$api = 'http://data.zz.baidu.com/urls?site=www.xxxxxxx.com.cn&token=F9bADE21dfdfd';
$ch = curl_init();
$options = array(
CURLOPT_URL => $api,
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => implode("\n", $urls),
CURLOPT_HTTPHEADER => array('Content-Type: text/plain'),
);
curl_setopt_array($ch, $options);
$result = curl_exec($ch);
echo $result;
}
其中 http://www.xxxxxxx.com.cn/stock.php/index/Blog/wen2019121501 是具体的网页
$api = ‘http://data.zz.baidu.com/urls?site=www.xxxxxxx.com.cn&token=F9bADE21dfdfd’; 在https://ziyuan.baidu.com/linksubmit/index 的链接提交 的