blo.gs

I rather like the service that blo.gs provide (via Simon Willison). You can “ping” them when you update your blog, and they register the change — they also monitor pings to weblogs.com, who provide a similar service). Then, however, you can register yourself an account there and “subscribe” to blogs, and then grab a list of all yor subscribed blogs and when they were last updated. This is neat, and it’s in action on my blogroll on the homepage. This is the way stuff should work — automatic updates for everything. Pretty much everything I read was already on blo.gs, mainly because most of the blogging software that’s around now will automatically do pings to weblogs.com. Kudos to Aquarion for making Klind do pings, too, since he’s rolled his own blogging system. What I’d like to see now is something that works similarly for comments, because I leave comments all around the place on people’s blogs and then forget where I left them, so I don’t know whether they ever got a response. I can’t quite work out a way of doing this, though; it needs to be automatic. More thought required. Whoever cracks this will be famous. :) Meanwhile, all I have to do now to add another blog to my blogroll is to subscribe to it at blo.gs, which is pretty darn fabulous. I hear you asking: good Lord, how did you do that, eh? It was easy. The power of XML. (And Castalian, naturally.)

<?cas
import xml.dom.minidom,urllib,rfc822,time
# The favourites file is fetched from blo.gs once per hour by cron
fp = urllib.urlopen("http://www.kryogenix.org/days/blo.gs-favourites.xml")
dom = xml.dom.minidom.parseString(fp.read())
upd = dom.documentElement.getAttribute('updated')
updtime = time.mktime(rfc822.parsedate(upd))
for n in dom.documentElement.childNodes:
    if n.nodeType == n.ELEMENT_NODE:
        if n.tagName == 'weblog':
            nam = n.getAttribute('name')
            tme = updtime - int(n.getAttribute('when'))
            tme = time.strftime('%d/%m %I.%M %p',time.gmtime(tme))
            url = n.getAttribute('url')
            response.write('<a href="%s">%s</a> (%s)' % (url,nam,tme))
?>

And that’s all there is to it! ——-

More in the discussion (powered by webmentions)

  • (no mentions, yet.)