Michal Čihař - Pinging blog indexing services

Pinging blog indexing services

When I noticed that something like indexing services for blogs exists, I hacked simple dog command to download ping page. This worked more or less, but it didn't gave me any feedback. Today I decided it's time to switch to something more sophisticated.

As most (if not all) services are using XML-RPC with same functions, implementing this in python using xmlrpclib was quite easy. After few minutes reading documentation I had working code which can be attached to publish command in nanoblogger:

import xmlrpclib
import sys

def do_ping(url):
    print "Pinging %s ... " % url,
        s = xmlrpclib.ServerProxy(url)
        r = s.weblogUpdates.ping("Nijel's Weblog", "http://blog.cihar.com/")
        if r['flerror']:
            print "FAILED"
            print " error: %s" % r['message']
            print "ok"
    except Exception,v:
        print "FAILED"
        print " error: %s" % str(v)


I'm only affraid that ping services don't like me much now as during testing I produced lots of pings :-).