郑州SEO论坛-服务郑州广大SEO爱好者!

标题: 据说能秒收!利用百度的PING RPC2服务-DZX2.5和 2.0通用! [打印本页]

作者: 漂泊    时间: 2013-1-18 14:56
标题: 据说能秒收!利用百度的PING RPC2服务-DZX2.5和 2.0通用!
发这个帖子没什么别的意思,就是发现一些人,好吧,是有的人。利用一些站长小白不懂的心理赚取自己的那什么钱。哎,想想我就觉得悲哀。

以下内容教程也是我在这插件区扒的,具体地址也没记下来,对不住了。
关于利用百度ping功能实现秒收录的那个教程吧,我就发给大家参考,千万别去再花不必要的冤枉钱了!
提醒大家:多搜索,多参考,多动脑,多动手,别身为一个站长整天懒的就指望花点小钱解决问题了。
废话不多说,进入正题(转载的,如有侵权请告之):

一、利用百度搜索引擎的PING RPC2服务功能来达到搜索引擎快速收录帖子(推荐)
实现原理:
根据百度站长平台的提示(http://zhanzhang.baidu.com/tools/ping),网站程序可以通过PING RPC2服务自动提醒百度搜索引擎收录你的网站,实时收录的哦!

实现办法:
1、首先新建一个新文件,文件名自定,放Discuz! X论坛的根目录!要自定名字的原因是,虽然百度提倡这么干,但是你不能老重复的提交啊,老虎屁股动不得!所以改名,以免别人捣蛋,你的站K了啥的,就别赖我了!
我这里暂定名为: BT_BAIDU.php这里修改网址,将我的站点地址(https://www.0371zl.com/)改为你的。

开启了伪静态的ping.php代码用这个:


作者: 漂泊    时间: 2013-1-18 15:01
<?php
if(isset($_GET['action']))
{
$canshu=$_GET['action'];
}
                           
                           
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>7D影视资源论坛-IPTV论坛-SinmpleTV论坛</string></value></param>  
<param><value><string>https://www.0371zl.com/</string></value></param>  
<param><value><string>https://www.0371zl.com/thread-$canshu-1-1.html</string></value></param>  
<param><value><string>https://www.0371zl.com/forum.php?mod=rss</string></value></param>  
</params>  
</methodCall>";  
$res = postUrl('http://ping.baidu.com/ping/RPC2', $baiduXML);  
                           
                           
if ( strpos($res, "<int>0</int>") )  
{  
header ("Location:https://www.0371zl.com/thread-$canshu-1-1.html");
}  
else
{  
header ("Location:https://www.0371zl.com/thread-$canshu-1-1.html#");
}  
?>

作者: 漂泊    时间: 2013-1-18 15:06
未启了伪静态的ping.php代码用这个:
<?php
if(isset($_GET['action']))
{
$canshu=$_GET['action'];
}
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>郑州seo论坛</string></value></param>  
<param><value><string>https://www.0371zl.com/</string></value></param>  
<param><value><string>https://www.0371zl.com/forum.php?mod=viewthread&tid=$canshu</string></value></param>  
<param><value><string>https://www.0371zl.com/forum.php?mod=rss</string></value></param>  
</params>  
</methodCall>";  
$res = postUrl('http://ping.baidu.com/ping/RPC2', $baiduXML);  
if ( strpos($res, "<int>0</int>") )  
{  
header ("Location:https://www.0371zl.com/forum.php?mod=viewthread&tid=$canshu");
}  
else
{  
header ("Location:https://www.0371zl.com/forum.php?mod=viewthread&tid=$canshu#");
}  
?>
作者: 漂泊    时间: 2013-1-18 15:09
2、修改文件source\include\post\post_newthread.php,

Discuz X2.0修改方法:

找到

1 showmessage('post_newthread_succeed', "forum.php?mod=viewthread&tid=$tid&extra=$extra", $param);

替换为(其中ping_seo为你自己的自定义ping文件名称):

1 showmessage('post_newthread_succeed', "ping_seo.php?action=$tid", $param);




Discuz X2.5修改方法:

找到

showmessage('post_newthread_succeed', $returnurl, $values, $param);

替换为(其中ping_seo为你自己的自定义ping文件名称):




1 showmessage('post_newthread_succeed', "ping文件的文件名称.php?action=$tid", $values, $param);

OK,简单两步完成,需要花冤枉钱么?

Tips:
如果PING失败,那么你发新帖后跳转的网址最后面会有一个#号!
测试是否PING成功,也可以访问http://你的DZX网址/ping文件的文件名称.php?action=任意新帖子ID,不成功的话,网址后面会有#号。


作者: wzzy999    时间: 2013-1-18 16:17
好东西 好方法,可是。。真的有效吗
作者: wzzy999    时间: 2013-3-11 10:03
这么好的一个帖子 赶紧顶上去 让大家都用上 秒收最好了  




欢迎光临 郑州SEO论坛-服务郑州广大SEO爱好者! (https://www.0371zl.com/) Powered by Discuz! X2.5