为PJBlog3添加ping功能

什么是网站的ping功能?
http://429006.com/article/Technology/882.htm

PJBLOG3的修改方式如下:

1、打开 blogpost.asp 找到:

Set lArticle = Nothing

2、在下面添加:

Const PingContent="http://www.feedsky.com/api/RPC2|http://blogsearch.google.com/ping/RPC2|http://api.my.yahoo.com/RPC2|http://www.zhuaxia.com/rpc/server.php|http://blog.yodao.com/ping/RPC2|http://www.xianguo.com/xmlrpc/ping.php|http://api.moreover.com/ping"
Function SendPing
Dim Url,Urls
Urls=Split(Replace(PingContent,vbCr,""),"|")
For Each Url In Urls
If Trim(Url)<>"" Then
Call SendPing_Single(url)
End If
Next
End Function

Function SendPing_Single(url)
On Error Resume Next
Dim s,sUrl
If blog_postFile = 2 Then
sUrl = siteURL&"article/"&postLog(2)&".htm"
else
sUrl = siteURL&"default.asp?id="&postLog(2)
end if
s = ""
s = s&"weblogUpdates.ping"
s = s&" "&SiteName&""
s = s&" "&sUrl&""
s = s&""
Response.Write "

发送Ping到:" & Url & "

"
Response.Flush
Dim objPing
Set objPing = Server.CreateObject("MSXML2.ServerXMLHTTP")
objPing.SetTimeOuts 10000, 10000, 10000, 10000
'第一个数值:解析DNS名字的超时时间10秒
'第二个数值:建立Winsock连接的超时时间10秒
'第三个数值:发送数据的超时时间10秒
'第四个数值:接收response的超时时间10秒
objPing.open "POST",url,False
objPing.setRequestHeader "Content-Type", "text/xml"
objPing.send s
Set objPing = Nothing
Err.Clear
End Function
Call SendPing

如果需要修改或者增减Ping地址,请修改“PingContent="”,用|分开。

常用博客ping地址:
http://www.feedsky.com/api/RPC2
http://blog.yodao.com/ping/RPC2
http://blogsearch.google.com/ping/RPC2
http://www.xianguo.com/xmlrpc/ping.php
http://www.zhuaxia.com/rpc/server.php
http://rpc.pingomatic.com
http://api.moreover.com/ping
http://api.my.yahoo.com/RPC2
http://rpc.weblogs.com/RPC2
http://rpc.blogbuzzmachine.com/RPC2
http://www.blogsnow.com/ping

更多博客ping地址:
http://429006.com/article/Technology/880.htm

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *