Snakes & Ladders – Learning Python & Playing with Flickr

41624928_efb5b4b0ae_t.jpgSo I couldn’t sleep and was looking for something todo… and I started browsing around flickr and found the Flickr Wallpaper pool. Now I love collecting background pictures, I have thousands… so I wanted something that could download the newest ones in the pool easily.

After a little bit of fiddling I found out the easiest way to get the images would be to parse the RSS feed for the pool, the RSS feed contains links to the full size images for the newest 20 images in the pool. Because I’m busy trying to learn Python and because I really didn’t feel like writing this in C# or something like that I thought I would have a go in Python.

After about an hour of writing code and a little bit of research on the web I came up with

So what is flickr feed? well basically it uses FeedParser to parse the Wallpaper Pool’s RSS feed, gets the links to the images from it and then
downloads the images.

This was all done at about 2am so it isn’t perfect, but it works and it was fun to write. I also should warn you that this is the first Python code I’ve written that actually does something.

Part of the original idea was to set the windows desktop image to one of the images in the feed but I couldn’t work out how todo that on Windows I think it will require writing to the registry which I don’t particularly want todo. (The app was written on my Windows XP laptop using Notepad2 and the Python command line interpreter to test things.)

Special thanks goes to Gary & Richard for letting me use their internet connection while I was there…

Download the script.

To run it you’ll need Python and the FeedParser python libs.
Leave a comment if it doesn’t work or you have any trouble…