聯(lián)系官方銷售客服
1835022288
028-61286886
我需要一個(gè)ping提交的功能
就是把新的網(wǎng)址主動(dòng)通過ping提交給百度
這個(gè)是網(wǎng)上找到的代碼,我應(yīng)該如何改造,放在哪個(gè)位置?
<?php function postUrl($url, $postvar) { $ch = curl_init(); $headers = array( "POST ".$url." HTTP/1.0", "Content-type: text/xml;charset=\"utf-8\"", "Accept: text/xml", "Content-length: ".strlen($postvar) ); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POSTFIELDS, $postvar); $res = curl_exec ($ch); curl_close ($ch); return $res; } $baiduXML = " <?xml version=\"1.0\" encoding=\"UTF-8\"?> <methodCall> <methodName>weblogUpdates.extendedPing</methodName> <params> <param><value><string>網(wǎng)站名稱</string></value></param> <param><value><string>http://www.xxxxx.com</string></value></param> <param><value><string>http://www.xxxxx.com/archives/879/</string></value></param> <param><value><string>http://www.xxxxx.com/feed/</string></value></param> </params> </methodCall>"; $res = postUrl('http://ping.baidu.com/ping/RPC2', $baiduXML); //下面是返回成功與否的判斷(根據(jù)百度ping的接口說明) if (strpos($res, "<int>0</int>")) echo "PING成功"; else echo "PING失敗"; ?>
插件版權(quán):第三方插件
插件名稱:ping提交
插件名稱:ping提交
沒有見過這種插件啊,多少錢買的
回復(fù)@電腦大師 不要錢的 這是一個(gè)老功能 據(jù)說他*的比百度站長功能 效果還好
ping是多年前的百度殘舞了,現(xiàn)在都絕跡了,用了沒效果
ping過去式了,沒什么鳥用
ping確實(shí)現(xiàn)在沒有什么作用了
沒必要去ping了,沒有實(shí)際意義,幾年前的技術(shù)了
百度主動(dòng)推送
接口地址:https://ziyuan.baidu.com/linksubmit/ind...
用這個(gè)官方插件吧