Michal Čihař - Archive for June 9, 2006

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,
    sys.stdout.flush()
    try:
        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']
        else:
            print "ok"
        sys.stdout.flush()
    except Exception,v:
        print "FAILED"
        print " error: %s" % str(v)

do_ping("http://ping.blo.gs/")

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

Happy blogging with nanoblogger

More than month after starting this blog, it's time to summarise experiences with nanoblogger. I enjoy blogging this way much more than previously used web based interface on abclinuxu.cz. Partly this is caused by change in editing (vim is much better than textarea in browser), another reason definitely is markdown which allows me to forget about HTML in most cases.

Anyway this way leads to creating many short posts, while previously I usually posted longer stories. I don't know which way is better and readers do prefer :-). So I will try to keep rate on approximately one (short) post per day.

And back to nanoblogger. It's not perfect system, however I was not able to find better suited for me. Generating blog is quote slow, but I don't care much. I had to switch to CVS version because some URLs were wrong in rc. And I had to modify even this CVS version to fit my needs, but those were only small changes. If you want text editor driven blogging system without comment support, nanoblogger might be good choice for you, otherwise you probably need something else.