Ping-o-matic and xml-rpc

Saturday 12 June 2004

This blog runs on home-grown software, so it usually lags in technology behind the usual blog software. I’ve been pinging weblogs.com and blo.gs for a long time, and figured I could skip the other services because I didn’t want to track down how to do each one.

Today I discovered Ping-o-Matic, which is a meta-pinging service: you ping it, and it pings everyone else. Handy. But it has an XML-RPC interface, and that’s one of the things I had never spent the time to learn how to do. Well, it couldn’t be easier. The Python xmlrpclib module makes the whole thing totally transparent:

import xmlrpclib

remoteServer = xmlrpclib.Server("http://rpc.pingomatic.com/RPC2")
ret = remoteServer.weblogUpdates.ping(
    "Ned Batchelder's blog",
    "http://nedbatchelder.com/blog"
    )
print ret['message']

So now I replaced two HTTP get pings with one XML-RPC ping, and I’m reaching more services. Sweet!

Comments

[gravatar]
Constantin 7:02 AM on 18 Oct 2008

Crazy! I searched an XML-RPC and PHP and there are no information. It's not so Handy you say i think! Damn...

Add a comment:

Ignore this:
Leave this empty:
Name is required. Either email or web are required. Email won't be displayed and I won't spam you. Your web site won't be indexed by search engines.
Don't put anything here:
Leave this empty:
URLs auto-link and some tags are allowed: <a><b><i><p><br><pre>.