Quick fun with AIR & Dailymugshot.com

So i’ve been playing with DailyMugShot.com for the past couple of months. DailyMugShot is just that – you take 1 picture every day of your mug. Well I wanted all my mugshots and there wasn’t a direct way of downloading them from the site. They have an RSS feed for your shots, but it only shows the current picture.

They do have a little flash based badge that you can post to your site.

So with some hunting around in the firebug output I found where the little flash piece calls a service for the sequence of images. The dataservice is simple XML (Yay!), and I like ActionScript 3 and XML. So, I wrote an AIR app that downloads all my mugshot images. It is really basic and urls and final file locations are all hard-coded, but it was a fun 45 minutes and worked like a charm and I have all my past mug shots.

Here are a few of my favorites:

Update: If you’d like to play with dailymugshot.com I’ve compiled an AIR Application that will download all the images for a given user ID (you can get the userID from the slide show page URL)


Adobe AIR – Issues with Command Line Arguments

After working on a little automation tool for video encoding process we ran into an interesting issue with AIR applications and command line arguments. Here is the scenario:

  1. Encoding process ends.
  2. The encoding process passes a file path to the waiting AIR application via command line.
  3. If the AIR app is not running, it starts up.
  4. The AIR application then checks some data in a database updates some tracking info and possibly grabs the duration out of the file.
  5. The AIR app waits for some more input.

Here is the issue – when the application starts up via the command line call, subsequent calls fail to the AIR application. Our solution, the AIR app has to be running when the OS starts up – that way the initial command line call to start the application doesn’t hold the process.

The command line looks something like in Windows:
C:/Program Files/ServerApplication/ServerApplication.exe “D:/my/storagedir/vidfile.f4v”

The command line looks something like on a Mac:
/Applications/ServerApplication.app/Contents/MacOS/ServerApplication “D:/my/storagedir/vidfile.f4v”

There has to be some way to start the application via the command line without holding everything up right? What am I missing?

Here is what I’m missing:
The new command line looks something like in Windows (added the /b option):
C:/Program Files/ServerApplication/ServerApplication.exe /b “D:/my/storagedir/vidfile.f4v”

The new command line looks something like on a Mac (added the ‘&’ at the end):
/Applications/ServerApplication.app/Contents/MacOS/ServerApplication “D:/my/storagedir/vidfile.f4v” &

Now our little automation AIR tool doesn’t need to be running when the first call happens – it will actually start up – and it can stay open and successfully receive new command line arguments.