织梦系统下熊掌号文章的自动提交,进入织梦后台文件夹,找到后面文件夹下的article_add.php。
找到
1 2 3 4 5 |
$artUrl = MakeArt($arcID,true,true,$isremote); if($artUrl==”) { $artUrl = $cfg_phpurl.”/view.php?aid=$arcID”; } |
$artUrl = MakeArt($arcID,true,true,$isremote);
if($artUrl==”)
$artUrl = $cfg_phpurl.”/view.php?aid=$arcID”;
在他下面加入
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
else{ $urls = array( ‘http://www.kfyun.com’.$artUrl.”, ); //下面部分用你自己的,上面固定连接改成你的 $api = ‘http://data.zz.baidu.com/urls?appid=你的熊掌ID&token=你的熊掌秘钥&type=realtime’; $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不要 } |
10
11
12
13
14
15
16
17
18
else{
$urls = array(
‘http://www.kfyun.com’.$artUrl.”,
);
//下面部分用你自己的,上面固定连接改成你的
$api = ‘http://data.zz.baidu.com/urls?appid=你的熊掌ID&token=你的熊掌秘钥&type=realtime’;
$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不要
然后在这个文件里找到下面这段代码:
1 |
<a href=’catalog_do.php?cid=$typeid&dopost=listArchives’><u>已发布文章管理</u></a> |
<a href=’catalog_do.php?cid=$typeid&dopost=listArchives’><u>已发布文章管理</u></a>
找到后在这段代码后面加入
1 |
<a href=”><u>百度提交返回”.$result.”</u></a> |
<a href=”><u>百度提交返回”.$result.”</u></a>
好了就这样就行了!
后面发布文章后就可以看见是否推送成功