网址改成你的域名,接口补充完整,保存代码到XX文件.php,访问一次就可以推送一次!
<?php
$server_name = $_SERVER['SERVER_NAME'];
function rand_str($length = 5)
{
$str = '';
$strPol = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz";
$max = strlen($strPol)-1;
for($i = 0; $i < $length; $i++)
{
$str .=$strPol[rand(0,$max)];
}
return $str;
}
$count = mt_rand(80,100);
$urls = array();
for ($i = 0; $i < $count; $i++)
{
$urls[] = "https://www.wdzzz.com".rand_str().'/'.rand_str().'.html';
}
$api = "http://data.zz.baidu.com/urls?site=https://www.wdzzz.com&token=xxxxxxxxxxxxxxxxx";
$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;
?>
