February 11, 2005

Flickr Uploader Folder Action for OSX

A couple of months ago I had the idea that it would be possible to use the OSX Finder to automatically (or "automagically," as the old Sysadmin term went) upload photos to Flickr when my camera was attached to my Mac, with no involvement from me. The logic went like this:

  • Flickr can get uploads from a UNIX command line
  • AppleScript can issue UNIX commands
  • the Mac Finder can automatically execute AppleScripts when a new object appears in a folder (a Folder Action)
  • Folders are created in the /Volumes directory whenever a new volume--such as my camera--is mounted

This chain of reasoning led me to calling on Josh Ellithorpe, who I asked to stitch together the Apple sample backup Folder Action to the Folder Action that fspiers, a Flickr user had put together.

Here's the standalone script, which does the same thing as the folder action, but without having to be invoked as a folder action, and here's the folder action.

It's still a rough proof of concept, but it works.

Here are Josh's instructions for installation:

property flickrmedia : "Flickr Media"
property subdir : "DCIM"
property eject_when_done : true
property emailaddy : "quest@mac.com"
property thepass : "YOURPASS"

flickrmedia - the name a folder in your Application Support directory. This is where you put an alias to the memorysticks or drives you want to auto upload.

subdir - on my camera it puts everything in DCIM... so
/Volumes/MEMORYSTICK/DCIM/Photodir1/photo.jpg. I figured yours would
have a similar layout, if not the exact same folder name.

[in my case it's /Volumes/SANDISK/DCIM/100PENTX/photo.jpg --mk]

The other options are painfully obvious.

Ok, so for my setup this is how everything works. Create the folder "Flickr Media" in "/Users/YOURUSER/Library/Application Support/". Inside that folder put an alias to any drive you wish to upload on mount. This is exactly how the Backup script works but not in your homedir which I thought was bad design.

The standalone is simple. If the alias is in your flickrmedia folder then you mount it (hookup the camera) and double click the file. Then it searches your memorystick/drive for /Volumes/MEMORYSTICK/SUBDIR where subdir is the folder you define in the applescript. So in my case it was /Volumes/Untitled/DCIM/. Then it lists the files in all folders in that subdir, my cam has many folders. Then it uploads them, and displays a dialog saying how many files it uploaded. Then the disk gets ejected if you set eject_when_done to true.

The folder action is installed exactly like the backup script.

The script is definitely a first generation pre-alpha thing. It doesn't tell you how much has been updated, it doesn't keep track of what's been updated and what hasn't, the Finder pretty much freezes while it's running (which can be quite a while) and, in general, it's not Flickr Uploadr, but if the goal is to experiment with making transparent technology--and that's what this is--it works.

So go and use this in health.

Posted by mikek at 02:18 PM | Comments (0) | TrackBack

December 17, 2004

More buildings at night

I took these in Amsterdam, Berlin and Middletown, CT, in the last couple of weeks:

Posted by mikek at 08:12 PM | Comments (1) | TrackBack

October 30, 2004

More wires and buildings

The two first photos in each series are of the lunar eclipse we just had. The moon is the little orange thing in the upper righthand corner.

And have I said how much I love my Pentax Optio s4i? It's a great little camera. So good, in fact, that I lost one in Bristol earlier this year and bought an identical one as soon as I got back.

Posted by mikek at 01:03 PM | Comments (0) | TrackBack

July 12, 2004

Power Lines/Clouds

Summertime in San Francisco brings the cold fog, which makes for spectacular sky-scapes and undoubtedly brisk business for the fleece vendors at Fisherman's Wharf and Union Square. I'm constantly looking at the clouds, but regularly get distracted by the power lines.

Posted by mikek at 07:40 PM | Comments (0) | TrackBack

June 10, 2004

The Earth from above

I spend a lot of time looking out the window of airplanes and I rarely tire of it. A big fan of Ad Reinhardt, I like the monochrome look of the sky, the clouds and the earth, and the slight curve of the world below.

Here are some pictures I took my most recent trip from Michigan to Oakland, I like the chiaroscuro effect created by the scratched porthole glass:

Posted by mikek at 10:48 AM | Comments (0) | TrackBack

May 31, 2004

Greetings from the Great Lakes State

I'm on vacation in Michigan, visiting the folks, the dog and the state I moved away from. Most of my time is spent in Ann Arbor, but I also got to spend a little time in Traverse City up north and Kalamazoo (as in "I got a gal in..."), in the middle-south of the state.

While we're on the Michigan tip, I would like to recommend Sufjan Stevens new record, who sings about Michigan a fair bit. Thought it's occasionally too wussy (learn some power chords, son!), it's good mellow folk rock.

Posted by mikek at 05:45 PM | Comments (0) | TrackBack

March 16, 2004

Jim, Mike, Rosetta

Courtesy of The Long Now Foundation, The Rosetta Project and the European Space Agency, I was given the once-in-a-lifetime opportunity to see a historic space mission, the Rosetta comet probe, launch.
Jim Mason, my friend and the director of the Rosetta Project, and I went to French Guiana to see it:
Jim and Mike in Kourou.
Backup Stage 3
(pictures by Michel van Pelt of ESA)

It was no ordinary launch, in many ways. It was in the middle of the night, during Carnaval, with the most expensive piece of scientific space hardware ever built in Europe. The contrast between the earthly chaos of Carnaval, the heat of the jungle and the space mission with its cryogenic fuels was one of the peak experiences of my life. Despite the fact that I was actually unable to see the thing lift off (Jim stayed for it, but getting in and out of French Guiana is tough and I took the charter back with most of the rest of the observers), I had an amazing time. Thank you to everyone who made it possible!

Posted by mikek at 01:53 PM | Comments (0) | TrackBack

December 23, 2003

Some recent photos

I've been writing so much lately for work that it's time to think in pictures a bit. Here's some I took recently.
The view from the train (Italy).
San Francisco near dusk when visited by Argus
Posted by mikek at 09:01 PM | Comments (0) | TrackBack

December 07, 2003

Florence Photos

While in Italy, Ray and I went to Florence for a couple of days. It rained the whole time, which was actually not bad. No lines, pretty nighttime photography, the feeling that we were in kind of a real city, rather than a real city that's become a cartoon version of itself (which it, of course, has, though not as much as Venice where there are companies that will partially chip the plaster off of old buildings to make them look age-worn). Here are some pictures.

First, things that were outside.
Now, inside.
Between the shells of Brunelleschi's Duomo dome
Proposals for fascade designs for the church. There were several hundred proposals over several hundred years before the Church settled on one in the 19th century. Tough client.
Posted by mikek at 01:34 PM | Comments (0) | TrackBack

December 06, 2003

Tracking the Flu

I got a flu shot yesterday because a friend of mine is sicker than she's been since high school and I figured I'd do my bit to fight the global pandemic. This morning I decided to see what the global pandemic was up to, and in doing so found the CDC's Influenza Tracking Reports, which have a nice week graph of where the flu is now. However, jumping between various graphs made it hard to see what was actually happening, so I decided to put the graphs side-by-side. That gave me the idea that they could actually be put on top of another, like an animated weather report, so I made this animated graph of how the flu spread across the country over in the last five weeks:

Sadly, the CDC graphs only look like they're identical. Whoever put 'em into the report every month actually uses a different size every time, so you'll have to excuse the ghosting. Also, I created intermediate images between each week's graph to ease the transition.

Posted by mikek at 10:44 AM | Comments (1) | TrackBack