September 9th, 2004  |  Published in web  |  4 Comments

Maybe you’re a python programmer. Maybe you think is kinda cool. Maybe you’d like to be able to do this:

>>> print len(delicious.Href("").posts())


>>> for post in delicious.users.mattb(delicious.tags.hackney):
...   print post.description,post.href
Phil Gyford selling his flat

or perhaps do something much, much cooler. is for you.

UPDATE: Since I published this code, Joshua Schachter has made the rules around use of APIs clearer. So that you can stay within these limits, you should be aware that no call to a method in will cause more than one HTTP request to This means that it’s left up to you to time your requests appropriately and politely, but at least you know that the code won’t spam of its own accord.

As with audioscrobbler a few months back, has been around for a while but last week really started to show up on the radar. I’ve been poking it with bits of code in the hope of achieving enlightenment.

I started by posting a few things: doing some linklogging, scripting an extraction of my items from The Daily Chump into a tag of their own, and extracting and posting pictures from my photo site under a username of their own with simple tags derived from the foaf and wordnet RDF annotations in that site’s RSS. I pointed to the picdiary experiment on the Semantic Web Interest Group IRC channel, and got some interesting discussion out of it.

The python wrapper that I used for most of this is fairly simple in structure. It uses a combination of Redland‘s RDF parsing (for the pleasantly fulsome RSS bits) and libxml2‘s HTML parser for the bits I needed to screenscrape. Href, User and Tag objects are used throughout, and can be used in combination. You can ask a User for all the posts from the user, or restrict it by passing one or more Tags into its post() method, and the converse for the Tags. It’s got some nice python automagic, creating Tag and User objects when you use syntax like “” or “” and providing __iter__ methods that allow the “for post in” usage.

There’s a bit of an example in the module’s __main__ code, which will take a username and find all the users that also posted two or more URLs posted by that user, and tell you what tags others used for the URLs posted by that user.

This code has evolved out of my own needs, rather than having a goal in particular. If you find it useful, I’d love to hear from you.


  1. shanti's daily links says:

    September 11th, 2004 at 10:06 am (#) experiments experiments…

  2. Leandro Siqueira says:

    October 7th, 2004 at 12:51 am (#)

    Se voc

  3. Blog says:

    November 20th, 2004 at 3:38 pm (#)

    This guy’s python hacking makes “”: usable. It’s exciting just to see a keyword-based (rather than hierarchical) category system being used (also see “GMail”:, but without “”:http://ww

  4. townx says:

    January 28th, 2005 at 4:10 pm (#) extensions

    Found an interesting Java API for working with at:

    I’ve also been working on some Python scripts for parsing a Mozilla bo