I have been trying to automate code that will get google to ping my rss feed every time a new post is entered. From the google blog search. ( http://blogsearch.google.com )
http://www.google.com/help/blogsearch/pinging_API.htmloutlines a few methods. The one that looks the easist is the REST client with the following parameters:
A REST client should construct requests with the following elements:
URL: http://blogsearch.google.com/ping
Parameters:
name = name of blog
url = URL of blog
changesURL = URL of RSS, RDF, or Atom feed (optional)
The response will be plain-text content of either "Thanks for the ping.", if successful, or an error message.
The example they give is:
http://blogsearch.google.com/ping?name=Official+Google+Blog&url=http%3A%2F%2Fgoogleblog.blogspot.com%2F&changesURL=http%3A%2F%2Fgoogleblog.blogspot.com%2Fatom.xml
This looks simple to use so I wrote the following code:
'***************** ADDED BY DAVE ARNOLD TO PING THE GOOGLE BLOG WHEN A RECORD IS UPDATED ***************
sub PingGoogleBlog (ChangedRec)
' Intruduce the url you want to visit
GotothisURL = "http://blogsearch.google.com/ping"
'QStr = "?name=First Aid Cafe&url=http://www.firstaidcafe.co.uk/Forum/SS_topic_feed.asp&changesURL=http://www.firstaidcafe.co.uk/Forum/RSS_post_feed.asp?" & ChangedRec
Qstr = "?name=First+Aid+Cafe&url=http%3A%2F%2Fwww.firstaidcafe.co.uk%2FForum&changesURL=http%3A%2F%2Fwww.firstaidcafe.co.uk%2FForum%2FRSS_post_feed.asp%3FTID%3D" & ChangeRec
'server.urlencode(QStr)
' Create the xml object
Set GetConnection = CreateObject("Microsoft.XMLHTTP")
' Conect to specified URL
GetConnection.Open "get", GotothisURL & Qstr, False
GetConnection.Send
' ResponsePage is the response we will get when visiting GotothisURL
ResponsePage = GetConnection.responseText
'Response.write (ResponsePage) 'for test
Set GetConnection = Nothing
end sub
'*******************************************************
it linked into the bottom of save new topic in new_post.asp just before the end if:-
'Re-run the Query once the database has been updated
.Requery
'Read in the new topic's ID number
lngTopicID = CLng(rsCommon("Topic_ID"))
'Set the rerun page properties
intReturnPageNum = 1
'Clean up
.Close
End With
'************************ ADDED BY DAVE ARNOLD *********
PingGoogleBlog "FID=" & intForumID
'*******************************************************
End If
The code get triggered correctly and I know that the code works as expected BUT it does not get google to ping the site. So I'm not sure if it's the querystring format or somthing else.
Any ideas.
PS
If I manually ping the service using just the RSS URL at http://blogsearch.google.com/ping the postings are listed.
Regards
Dave.