发布时间:2016-07-04 11:13:28编辑:丝画阁阅读(561)
class baidutuisong{
public function baidutuisong(){
//$list = C('SITE_BAIDU_TUISONG');
$urllinks = array();
$httpd = '';
$content= file_get_contents('http://www.xxxx.cn/baidutuisong.txt');
$reg = "/[\n\r]/";
$urllinks = preg_split($reg,$content,-1,PREG_SPLIT_NO_EMPTY);
srand ((float) microtime() * 10000000);
$rand_keys = array_rand ($urllinks, 495);
$return = array();
foreach($rand_keys as $key){
$return[] = $urllinks[$key];
}
$api = 'http://data.zz.baidu.com/urls?site=www.xxxx.cn&token=a69pHzug68Yy2eNA';
//http://data.zz.baidu.com/urls?site=www.ftxk.cn&token=qlO6mSKjE4Dfzp8D&type=original
$ch = curl_init();
$options = array(
CURLOPT_URL => $api,
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => implode("\n", $return),
CURLOPT_HTTPHEADER => array('Content-Type: text/plain'),
);
curl_setopt_array($ch, $options);
$result = curl_exec($ch);
echo $result;
}
}
$tuisong = new baidutuisong();
echo $tuisong;
关键字:
上一篇:JS判断设备
下一篇:asp.net创建站点地图
本站部分内容来源网络及网友上传,本站未必能一一鉴别其是否为公共版权或其版权归属,如果您认为侵犯您的权利,本站将表示非常抱歉!
请您速联系本站,本站一经核实,立即删除。删文删帖联系【2789291421@qq.com】