Ping Google Blog Search Using Ruby

radar dish Photo by leedsyorkshire

With the following class, you can ping Google’s blog search whenever you update your blog:

require 'xmlrpc/client'

class BlogPing
  def self.ping(site_name, site_url, page_url, feed_url)
    begin
      server = XMLRPC::Client.new2("http://blogsearch.google.com/ping/RPC2")
      server.call2('weblogUpdates.extendedPing', site_name, site_url, page_url, feed_url)
      return true
    rescue => detail
      puts "ping failed (#{detail})"
      return false
    end
  end
end

With any luck, it just worked on this post!


Related Posts

  1. Feedtools Database Cache
  2. SPF Records with Rails and ActionMailer
  3. Authlogic, Passenger, and cookie_store Sessions Don't Mix
  4. iPhone/iPad UISearchBar and UISearchDisplayController Asynchronous Example
  5. Write Facebook Apps Using Google Appengine
You should follow me on Twitter: @patrickxb