Technorati trackbacks

BoingBoing's other blogs commenting on this post feature, added yesterday, has provoked a flurry of responses. Co-incidentally, I had just made myself a Technorati Trackback bookmarklet: drag this link -- TT -- to your toolbar, then click while visiting a blog article to see Technorati's roundup of posts commenting on the article.

As Cory Doctorow mentioned in an email I was cc'd on, the "other blogs commenting" feature ideally should display the count of inbound links, or, in case there are none, vanish. Here's a picture of a trial implementation:

There are two moving parts. First, a service that asks Technorati for the count, and returns some JavaScript. Here's the guts of my trial implementation:

tsearch = ''
tpage = urllib.urlopen(tsearch + '?url=' + url).read()
m = ('from <span class="greentext">(\d+)</span>',tpage)
count = int (
return """
document.write('Technorati comments: 
<a href="">%d</a>')
""" % (url, count)

Second, a template modification to call this service for each published item, passing the permalink of the item, and including the results in a <script> tag.

This is the classic pattern for pages that are dynamically generated but statically served, as is true for most blogs. You make client-side JavaScript add up-to-the-minute information at page-load time.

Although I can host the service that queries Technorati, I'd rather not, and in any case most bloggers can't. So I've disabled the feature for now, but I'd love to see Technorati offer a callable counter.

Former URL: