The Bull Og

Onine since 1994. Offline since 1976.

See also the archive

An individual post follows.

I didn't really want to pay $333/month to hone my Python chops so I decided to get my hands dirty with some Ruby instead (on a side note, I am currently looking to recruit Front-end Engineers and a Front-end Engineer manager if you know of any...)

I decided to formulate a different task for myself:

TASK: Given a set of albums in a 1.4.4-pl4 version of Gallery, write a script that uploads them to Flickr and sets properties accordingly so that they appear in the correct chronological order.


I've been using Gallery for a long time to curate my photos, long before Flickr came on the scene. I'm a big believer in YDYS (Your Data is Yours) and didn't like uploading my photos to big servers in the ether so I hosted my own photos with Gallery.

Well, time marches on and when you manage your own photo gallery online then you have to manage the software that manages your photo gallery. I have to admit (and you can pretty much tell when it happened by the version number,) my gallery fell into disarray and I didn't tend to it as much as I should.

Now that I don't have quite as much time for outside projects as I once did, I thought "it's time to upgrade to a service like Flickr and let them manage the infrastructure while I take care of capturing and sharing memories."

DISCLAIMER: I get the Flickr Pro upgrade for free because of where I work. It's probably necessary to have the Pro account before you attempt the uploads using the techniques that I'm eventually going to use.

I'll have some time to get started this weekend, but here are some initial steps as to what I think I'll need to do to parse photo data out of the Gallery files.

- Create a B-Tree (we'll need it for date-tracking as we process each of the photos)
- Glob a list of photos.dat files recursively
- Foreach photos.dat file...
-       Open file
-       Slurp file (can do in Ruby?)
-       Parse syntax
-       Foreach photo
-               Find uploadDate
-               Do lookup in B-Tree on uploadDate and/then...
-               Stick Album Name and File Name in B-Tree for uploadDate
-       Close file
- Traverse the B-Tree and print out: "Album Name, File Name"