perl

Backing up your flickr account with Perl (not for the faint of heart)

Posted December 9th, 2007 by mattm

[NOTE: see the first comment below, I added a script to get the auth_key for you.]

Today I decided that I would like to backup my flickr account to my Mac. After a few attempts at using a Java based UI tool "FlickrBackup", which had terrible network performance for some reason, I fell back to my trusty old Perl skills.

Here is what I did:

1. Install Net::Flickr::Backup

To install this module, open up a terminal and type:

cpan

When CPAN loads up, type:

install Net::Flickr::Backup

Its pretty much that easy.

2. Go to Flickr.com and create an API key. Create one for a web application, and enter pretty much any valid url as your callback. I know, its not a web application...just do it, k?

3. Get an auth_token. This is harder than it needs to be, but here is how I got it done:

- First get a frob. This page shows you how to do it manually. Mac OS X has a terminal command, "md5" that you can run to make your api_sig value. for example:

md5 -s 000005fab4534d05api_key9a0554259914a86fb9e7eb014e4e5d52permsread

Which would yield a MD5 hash of: f2c52fb8fd3124314227bbc0f48003d3

Which it turn would mean the auth url needs to be like:

http://www.flickr.com/services/auth/?api_key=9a0554259914a86fb9e7eb014e4...

Once the URL is constructed, paste it into a browser, and approve access to your account. Once you approve, flickr calls your callback url. I just made my callback a bogus url like http://mattmackenzie.com/authdummy/