destoon7.0-8.0移动端自动推送百度,配合pc实现快速收录,代码如下
找到:/include/mobile.inc.php,在第五行左右
require DT_ROOT.'/include/mobile.func.php';
下添加以下代码
/百度移动端推送 $mobpingurl= 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; $api = "百度移动端推送接口"; $ch = curl_init(); $options = array( CURLOPT_URL => $api, CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_POSTFIELDS => $mobpingurl, CURLOPT_HTTPHEADER => array('Content-Type: text/plain'), ); curl_setopt_array($ch, $options); $result = curl_exec($ch); // echo "推送结果为".$result."推送的url为:".$mobpingurl; //百度移动推送结束
这样就好了,只要移动端访问就会主动推送,提高蜘蛛抓取