分类地区批量推送熊掌号+主动推送代码
根据dt7.0写了一个非常简单的分类地区批量推送百度熊掌号+普通主动推送
<?php /* 百度主动推送三项合一功能 作者:68喜 功能模块:地区推送 */ //错误显示屏蔽 require ‘./common.inc.php‘; //引入公用函数 $domain=$CFG[‘url‘]; $module="invest/";//目录模块 $catid=1118;//分类id $qian="search-htm-kw-"; $zhong="-catid-"; $hou=".html"; for($areaid=1;$areaid<392;$areaid++){ $urls.=$domain.$module.$qian.$areaid.$zhong.$catid.$hou.","; } $urls=substr($urls,0,-1); $urls = explode(",",$urls); //接口推送 $api = ‘api‘;//熊掌号当天推送 $bdxzhapi=‘api‘;//熊掌号历史推送 $pttsapi=‘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."<br/>"; $options = array( CURLOPT_URL => $bdxzhapi, 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."<br/>"; $options = array( CURLOPT_URL => $pttsapi, 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."<br/>"; ?>
例如这样的:http://www.sdfymj.com/invest/search-htm-areaid-1-catid-1118.html 的地址批量推送给百度
相关推荐
83911535 2020-11-13
曾是土木人 2020-10-31
yegen00 2020-10-21
soralaro 2020-10-11
katanaFlower 2020-09-18
wytzsjzly 2020-08-17
88407710 2020-08-17
ChinaJoeEE 2020-08-16
CyborgLin 2020-08-15
Blueberry 2020-08-15
PinkBean 2020-08-11
katanaFlower 2020-08-03
hunningtu 2020-07-30
阿债的方寸天地 2020-06-28
pingyan 2020-06-25
wytzsjzly 2020-06-25
阳光岛主 2020-06-25
阿债的方寸天地 2020-06-16