18 February 2007

FlickrTop 1.0

I like a nice selection of rotating desktop wallpapers and I also love the wealth of pictures available at Flickr. I set out to write a quick application to fetch pictures from Flickr favourites. I started in Ruby but then that's because I wanted to pick it up. I grew bored of it and moved back to the familiar territory of Java even though it is total overkill. Before I start wittering to much this is a command line program and requires you to put values in a properties file. As it is I'm starting with just the code, so you need to compile it yourself. If you feel happy with properties files but not running javac then get in touch and I can include a compiled version.

Anyway there is a few things this program does and quite a few it doesn't. It just fetches from the Flickr REST API and then tries to download the large version of the image. First if the large image isn't available Flickr just hands out a placeholder. Some wallpaper changers ignore this, others don't you might need to delete these. Second it doesn't bother to get more than the first 250 favourites, this is because I haven't bothered to check how many pages there should be. This is pretty trivial to fix and I will do soon. Next if an image already exists in the specified folder with that name it doesn't overwrite that. First this protects images that maybe just have the same crazy naming format as Flickr images but it also saves bandwidth. I don't consider this a bug and I ain't going to fix it. If you want to get fresh copies you can delete all the old ones or move them to another folder.

Along with the bugs mentioned above I'd like to add a few more features. The ability to get only particular sizes of images (say those that match your desktop size). The ability to filter by given tag(s) so you can get just particular favourites. Finally the ability to get things from your own folder rather than your favourites (this is easy to do).

So if you are still reading now you probably just want to know what you need. Well you need to fill in the Properties file. So flickr.api.key is the API Key you have or can get. flickr.user.id is the user id of the user you want to point to, mine is 89764331@N00 the easiest way of finding out is viewing your avatar image. The URL has the number listed. Finally directory.location contains the directory the output should go to. It should match the format used by your OS.

If you are using OSX it has a wallpaper changer built in. So do many flavours of Gnome and KDE but your mileage may vary. If you are using Windows XP you can get a changer from Microsoft.

Grab the zip from my Google Pages. Finally for you tinkering types it is released under a Creative Commons By Attribution Share-Alike license, if that is even applicable to code. If not I just say play fair and the rest of that stuff :D.

No comments: