Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
34 lines (27 sloc) 1.68 KB
---
layout: post
title: Automated Technorati ping
date: 2007-09-27 22:19:11
updated: 2008-05-20 12:04:59
---
<div class="narrow-col">
<p><a href="http://www.technorati.com/" class="ext">Technorati</a>, a search engine for searching blogs, allows any blog owner to &lsquo;ping&rsquo; his/her blog. In this way Technorati can index your blog based on the tags you assigned to your post.</p>
<p>You can do this manually by requesting a ping with the &lsquo;<a href="http://www.technorati.com/ping/" title="Ping form to check when you pinged Technorati" class="ext">Technorati ping form</a>&rsquo; 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.</p>
<ol>
<li>First we'll need Ruby on Rails built in XMLRPC protocol and create a new client that listens to the Technorati web service.</li>
<li>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.</li>
<li>Now we only need to check if the request succeeded by looking at the result parameter and we are done.</li>
</ol>
{% highlight ruby %}
require 'xmlrpc/client'
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
{% endhighlight %}
<h2>Resources</h2>
<ul>
<li><a href="http://www.ruby-doc.org/stdlib/libdoc/xmlrpc/rdoc/" title="XMLRPC for Ruby, Standard Library Documentation" class="ext">XMLRPC for Ruby, Standard Library Documentation</a></li>
</ul>
</div>