Sidebar

Update on xkcdrss.py

Remember that little script I wrote to pull the latest comic from xkcd? Well, I actually got around to fixing up the readability and removing the horrible one liner.

Firstly, I moved from xml.dom.minidom to Mark Pilgrim’s (whose book Dive Into Python taught me the language) Universal Feed Parser and broke the parsing of the script up into a few more lines. It now looks much nicer, and will be considerably easier to maintain.

Also, I added an optional command line argument that specifies where to save the picture, defaulting to ./xkcd-today.png.

I won’t bother posting it inline, but you can find it at http://joshh.co.uk/stuff/xkcdrss.py.

Show/hide comment form