Commercial Break: Glue

I am generaly not a huge fan of scripting languages. I tend to view everything except C/++ as window dressing that isn’t ‘hardcore’ enough. While I’m aware that this is a ridiculous stance I just can’t help myself scoffing when a new API emerges with some custom scripting language attached that allows us to send OSC messages from ubuntu installed on a jailbroken toaster to a bluetooth enabled clown. However, in a recent spate of commercial work I have been forced to employ a significant amount of these application glue techniques and secretly quite enjoyed it.

I was commissioned by the South Bank to produce a photobooth setup that would allow users to take snaps of themselves and have those images uploaded to a flickr account in real-time. This was a sort of follow up to an installation peice I worked on for them the previous christmas. The basic setup was a C++ application based on OpenFrameworks code. This app took a high quality webcam feed and allowed users to snapshot themselves (with a count-in). The app also showed the last 4 photos that had been taken. All the snapshots were named with an appropriate datestamp and placed in relative folders. Then came the glue….

The best method to access the flickr api semed to be via scripting. I chose python since its ideal for gluing and bundles loads of nice xml parsing, url encoding ibraries etc. So I set up a python script to run in the background, checking the image dump folder every minute or so. If it found any new images it would call up flickr, work out if it needed to make a new set or add to an existing one and finally upload the new images with tags, descritions etc. Of course, with this being a public installation It was likely to receive a real hammering and I needed some way to keep all the apps up and working. The solution? More glue.

I installed a cron scheduler that ran a process watcher every few minutes. If the key processes were absent it restarts them. Essentialy this deals with the inevitable crashes and keeps the system running. Of course to do this invisibly (on windows) I had to use a combination of batch scripting and windows scripting (VB) alongside the processwatcher and cron tabs. This watcher chain keeping an eye on my webcam/C++/python chain of applications too. This may not sound like an unusual collection of processes to some people, but I am more used to working with single application production, so for me it was like a veritable zoo of code swimming around. But as I said earlier, I actually really enjoyed the challenge of linking the systems together and juggling all the syntaxes. You can see the result at http://www.flickr.com/photos/southbankcentre/ where it seems to be running fairly smoothly!

Im not ready to turn into a full time glue addict, but I can see how scripting systems made the development of this particular installation much smoother.

Leave your Comment

You must be logged in to post a comment.