Archive for 2004

python for perl programmers

December 10th, 2004  |  Published in python

Tomorrow I’m giving a talk at the rather wonderful London Perl Workshop. I’ve worked with quite a few languages in my time, including about 4 years or so of writing mostly perl. These days I write in python when I have a choice, so I’m going to give an introduction to python for perl programmers. Here are the slides. Nothing fancy, just the basics.

Read the rest of this entry »


November 11th, 2004  |  Published in xml

A new experience today: I’ve done my first bit of paid writing. It’s about again, and it’s on

It’s an expanded version of two previous posts previously made to hackdiary. It goes into a little more detail about how the code works, and gives more examples. There’s also more analysis, and more of an introduction for the uninitiated.

Read the rest of this entry » experiments redux

October 6th, 2004  |  Published in web

About a month ago, I posted about some experiments I’d been doing, and published the python wrapper I’d been using. Of course, the post itself was another experiment.

Read the rest of this entry » experiments

September 9th, 2004  |  Published in web

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.

Read the rest of this entry »

Work at the BBC (again)

August 23rd, 2004  |  Published in misc

There was a programmer’s job being advertised at BBC Radio and Music Interactive in London, in the team where I work. It involves data munging XML, digital radio and other interesting technologies, and involves programming in Python, Perl or Java. Applications have now closed.

Read the rest of this entry »

Loose ends

August 21st, 2004  |  Published in rdf

This weekend I’m at EuroFoo, and I’ve managed to find some happy hacking time. Jim Ley and Dan Brickley are around, and they’ve been nudging me into fixing up and releasing some old code.

Read the rest of this entry »

Adventures in XHTML and CSS

August 1st, 2004  |  Published in web

For my dad’s 60th birthday, my family and I produced a print book of memories and photographs from his life. I typeset it using OpenOffice 1.1 and sent it to the printers as PDF, which worked just fine. Today I’ve been creating an online version from the original document.

Read the rest of this entry »

Taking automated webpage screenshots with embedded Mozilla

June 13th, 2004  |  Published in python

The other day I discovered Hotlinks, a rather nice link aggregator. It collects links from sites (including those of a couple of my respected colleagues) and combines them into a good-looking summary page. I particularly like the automatic webpage thumbnails it makes, which are created using khtml2png. I couldn’t get khtml2png to compile on my machine. After finding that there are now python wrappers for GtkMozEmbed, I made my own screenshotter-and-thumbnailer by embedding the Mozilla browser component using a little python script.

UPDATE: Ross Burton picked up the script and made a couple of enhancements. Miguel de Icaza posted a C# version.

Read the rest of this entry »

Too much spam, time for dogfood

June 1st, 2004  |  Published in rdf

Over the weekend I was hit by over 200 MT comment spams, from a range of IP addresses. Using MT-blacklist I was able to clean up the damage, but wasted at least half an hour. In temporary despair, I’ve removed the comment forms from individual entries and disabled the comments cgi. For now, if you want to write something about one of my entries, go get your own website or something.

Read the rest of this entry »

Audioscrobbler meets the commandline

May 3rd, 2004  |  Published in python

It’s been around for a while, but suddenly everyone’s talking about audioscrobbler again. I got interested when I saw a talk about at dorkbot a few months back. It’s based on the simple idea of instrumenting your music player to send a ping to a central site every time you’re listening to a track. Going further than just a ‘now playing’ on a sidebar on your website, this leads to a world of potential new music toys using collaborative filtering and the like.

At home I play all my music from the commandline: my mp3 jukebox has no fancy user interface, I just SSH into it. Audioscrobbler have several player plugins for download, but no commandline interface. I wrote myself some python code to play MP3s and talk to audioscrobbler so that I could keep my profile up to date.

Read the rest of this entry »