百度搜狗组合提交代码

PHP 2019-10-28 10:26:47 评论
<?php

function baidu_php_push($urls){
$token = "0OvM2x4hMOfHhpf2";
$yuming = "
https://www.wygkym.com
";

//搜狗站长登录后的cookies
$ck0='SUID=1C15EE72D831990A000000005DB53906; SUV=1572157704157296; PHPSESSID=8l314rv23u810d8mcidj440ie4; sgid=15-43121071-AV21ORfbyscyCrqT83qn6Ag';//cookies
$ck1='SUID=1C15EE72D831990A000000005DB53C91; SUV=1572158610169738; PHPSESSID=b34nqlphte53fgcftctjcoklg3; sgid=29-43103401-AV21PKcHHVhQEE3LrhoCApY';
$reason='';//详细说明,可以为空
$email='[email protected]';//邮箱,不可为空

$cook = array($ck0,$ck1);
$cookies = $cook[rand(0,1)];
//随机字符
function suijizf( $length ) { 
$chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; 
$password = ''; 
for ( $i = 0; $i < $length; $i++ ) 
{ 
// $password .= substr($chars, mt_rand(0, strlen($chars) – 1), 1); 
$password .= $chars[ mt_rand(0, strlen($chars) - 1) ]; 
} 
return $password; 
} 


$data = explode(PHP_EOL,$yuming,1000);
$data_1 = array_unique($data); //array_unique函数:过滤重复的值
$data_2 = array_filter($data_1); //array_filter函数:过滤数组中为空的值
$ym = array_values($data_2);//array_values函数:被返回的数组将使用数值键,从 0 开始并以 1 递增。
shuffle($ym);
//$url[]='';
for($i=1;$i<=20;$i++){
$urls[]=$ym[0].'/2019/'.suijizf(8).'.html';
}
//百度提交
    $api = 'http://data.zz.baidu.com/update?site='.$ym[0].'&token='.$token;
    //print_r($api);
    $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;
    //header("Content-Type: image/jpeg;text/html; charset=utf-8");
    //echo file_get_contents('https://ae01.alicdn.com/kf/H29c1f0e1a5404055a059efc79d8f7ed9d.png',true);
//搜狗提交
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, 'http://zhanzhang.sogou.com/index.php/urlSubmit/create');
	$httpheader[] = "Cookie: ".$cookies;
	curl_setopt($ch, CURLOPT_HTTPHEADER, $httpheader);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS,$text);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
	curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.81 Safari/537.36 SE 2.X MetaSr 1.0");
    curl_setopt($ch, CURLOPT_TIMEOUT, 50);
    $output = curl_exec($ch);
    curl_close($ch);
	return  $output;

$arr=array_chunk($urls, 20);
foreach($arr as $v){
	$info= array(
	 "webAdr"=>implode("\n", $v),
	 "site_type"=>'2',
	 "reason"=>$reason,
	 'email'=>$email,
	 );
	//echo post($cookies,$info);
}

}
echo baidu_php_push($urls);
?>
上一篇:搜狗推送代码
下一篇:没有了

评论

说点什么吧
  • 全部评论(0
    还没有评论,快来抢沙发吧!