php推送百度脚本(泛目录版本)

这个脚本是推送随机url到百度,加快百度收录~
脚本内容:

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 = 50;
$urls = array();
for ($i = 0; $i < $count; $i++) 
{
      
	$urls[] = "http://域名/".rand_str().'/'.rand_str().'.html';
}

$api = "调用的百度api";
echo $urls;
$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;

如果还是不会可以在下面评论或者去群里下载
php推送百度脚本(泛目录版本)_第1张图片

你可能感兴趣的:(php)