Late to the party

I wrote a little program in Ruby (and I do mean little, Ruby continues to impress me with ease of getting things done) to get a semi-random picture from Flickr (checks for anything new from Stuck in Customs first, then gets a random picture tagged with “landscape” if there aren’t any), then set it as my desktop.  I set it to run every half hour as a cron job.  Then I set up GeekTool to get the current picture displayed (the ruby program writes it to a log file, I have GeekTool get the last line of that file) and display the title and user at the lower right of my desktop.

I figured there would already be several other programs way cooler than mine, but if there weren’t I figured I’d package it up with a few more options and release it.  Turns out, you can already do most of that without downloading any software at all.  You can subscribe to photo RSS feeds in iPhoto (news to me!) and you can then use photos from those feeds as desktop backgrounds directly from the Desktop preferences panel.  OS X and its packaged applications are just really impressive sometimes.

On the other hand, the randomly select a picture every X minutes feature doesn’t work with photo RSS feeds, so it doesn’t actually do everything my little program does.  I bet Leopard will.  But I’ve got at least a narrow window where I can release an app that does it and maybe someone will actually want it :)   Plus I can be a little more flexible – I don’t think you can do the trick I’m doing where a particular user’s pictures always go up when there’s a new one, but that depends more on how sophisticated you can get with Flickr’s RSS feeds.  I haven’t really looked at that.

It’s all mainly for my own education anyway, and I think I’m going to use it as an excuse to learn about RubyCocoa  and then maybe release something when I have a “real” standalone Mac app that normal Mac users can use.  (IE Requiring crontab editing is RIGHT OUT.) But if anyone reads this and wants the ruby script sooner than that, send me a note.  It was fun to write and fun to get all these great pictures on my desktop all the time!

2 Comments »

  1. Frothy Said,

    June 5, 2007 @ 10:47 am

    Have you looked at Quartz Composer yet? It’s an interesting visual development tool for working with graphics, and it has an RSS feed component. It’s possible to write a quartz composition to poll your feeds for images to display, and have ScreenSaverEngine.app run on the desktop with the -background switch. This has interesting possibilities, like transition effects, and integration with widgets.

    Right now it’s a second-class citizen, more of a sandbox to play around in than do serious development, but I’m hopeful 10.5 will bring big improvements, maybe roll it in with Dashcode. Still, it’s another one of OS X’s hidden gems.

    I’ve also been playing around, writing Automator actions in AppleScript. It’s a nice, easy intro to xcode and interface builder. It’s also surprisingly powerful. Like automator actions, widgets are sneered at by ‘real’ programmers (read ‘recent CS grads’) because they’re not ‘real’ apps, but I think that’s more a reflection on the commentator than anything else. If you can call native code from a widget, isn’t that ‘real’ enough?

    I’ll hold my rant on young programmers for another day… but widgets should get a boost when we find out that’ll be the way to get apps on the iPhone.

    -m

  2. Ogre Said,

    June 5, 2007 @ 10:56 am

    My interest in this is more learning Ruby for potential uses outside the Mac, especially as an embedded (“scripting”) language as part of a larger application (which will not be targeted solely at Macs).

    “Doing stuff with Ruby” is more the goal right now. Writing little Mac toys is the side effect.

    I don’t know how many people have used Ruby this way, Lua and Python are the usual choices right now, but Ruby’s got a lot going for it.

RSS feed for comments on this post · TrackBack URI

Leave a Comment