Created
February 2, 2009 11:21
-
-
Save nesquena/56886 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# controller when you post an update | |
Ping.notify |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# in config/initializers/ping.rb | |
PING_SERVICES = ["http://rpc.technorati.com/rpc/ping", "http://blogsearch.google.com/ping/RPC2"] | |
PING_BLOG_NAME = 'Danish Khan\'s Blog' | |
PING_BLOG_URL = 'http://danishkhan.herokugarden.com' | |
class Ping | |
def self.notify | |
PING_SERVICES.each{|service| | |
begin | |
server = XMLRPC::Client.new2(URI.parse(service).to_s) | |
result = server.call("weblogUpdates.ping", PING_BLOG_NAME, PING_BLOG_URL) | |
rescue => detail | |
logger.info("ping failed for server #{service} (#{detail})") | |
end | |
} | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment