DedeCMS接入百度站点天级收录及周级收录API
admin 阅读:130 2024-03-04
//百度资源平台自动推送
$notice = '完成百度资源平台收录推送!';
$type = strpos($flag,'h')===false?'batch':'realtime';//头条文章自动调用天级接口,否则调用周级接口
$chinesetype = strpos($flag,'s')===false?'周级':'天级';
$posturl = "https://m.www.codesou.cn/view.php?id=".$aid;
$api = 'http://data.zz.baidu.com/urls?appid=1621527503774131&token=plpD8YRwa33J5WKu&type='.$type;
$ch = curl_init();
$options = array(
CURLOPT_URL => $api,
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => $posturl,
CURLOPT_HTTPHEADER => array('Content-Type: text/plain'),
);
curl_setopt_array($ch, $options);
$result = curl_exec($ch);
上面代码加到dede/article_add.php中“//返回成功信息”之前。
声明
1、部分文章来源于网络,仅作为参考。 2、如果网站中图片和文字侵犯了您的版权,请联系1943759704@qq.com处理!



