This article was posted over one year ago, the information may no longer be acurate.
Automated Technorati ping with RoR
Technorati, a search engine for searching blogs, allows any blog owner to ‘ping’ his/her blog. In this way Technorati can index your blog based on the tags you assigned to your post.
You can do this manually by requesting a ping with the ‘Technorati ping form’ but let's have a look how we can automate this, shall we? Turns out it's really easy to do so even though it's hard to find some documentation about this on Google.
- First we'll need Ruby on Rails built in XMLRPC protocol and create a new client that listens to the Technorati web service.
- Next we call the weblogUpdates.ping service method and pass the name and URL of our blog. We'll keep returned result in the result parameter.
- Now we only need to check if the request succeeded by looking at the result parameter and we are done.
server = XMLRPC::Client.new("rpc.technorati.com", "/rpc/ping")
result = server.call("weblogUpdates.ping", "YOUR BLOG NAME", "YOUR BLOG URL")
if result['flerror']
flash[:error] = result['message']
end