Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Export tool for Flickr
branch: master

Merge pull request #15 from ianrenton/master

Added argparse dependency to docs
latest commit f21607dda5
Jaisen Mathai jmathai authored

Readme.markdown

Open Photo API / Export tool for Flickr

OpenPhoto, a photo service for the masses


Overview

This script fetches all of your photos from Flickr and stores them into text files which can then be easily imported to OpenPhoto.

Setting up an API key

Before you get started you'll need a Flickr API key.

  1. Go to http://www.flickr.com/services/apps/create/apply/
  2. Apply for a non-commercial key
  3. Provide a name and description (this can be anything)
  4. Take note of your key and secret, you'll need them soon
  5. Click Edit auth flow for this app
  6. Put anything in for the callback URL, http://theopenphotoproject.org works
  7. Save changes

Getting dependencies

The only dependencies you need the flickrapi and argparse modules.

sudo easy_install flickrapi argparse
# you may also use pip to install them
# sudo pip install flickrapi argparse

If you're using Ubuntu or Debian, installing using their packages should also work:

sudo aptitude install python-flickrapi python-argparse

Downloading the script

Using git

git clone git://github.com/photo/export-flickr.git

Using wget

mkdir export-flickr
wget -O export-flickr/fetch.py https://raw.github.com/photo/export-flickr/master/fetch.py --no-check-certificate

Using file->save

Click the link below and save the file into a directory named export-flickr.

https://raw.github.com/photo/export-flickr/master/fetch.py

Running the script

Start a terminal and enter the following.

cd export-flickr
python fetch.py --api-key=******************************** --api-secret=****************

For api-key and api-secret, enter what Flickr returned you in step 4 of above.

Next you'll be given a URL which you need to copy and paste into a browser. If you're not logged into Flickr you'll have to sign in. Once logged in you need to approve the application access to your account.

NOTE: This script ONLY asks for read permissions. If it's asking for write permissions throw your computer in the trash.

Open the following URL in your browser 
This Url >>>> http://api.flickr.com/services/auth/?perms=read&api_sig=********************************&api_key=********************************

After this you'll be redirected to the URL you specified as your callback. Copy and paste the entire URL into the terminal.

When you're ready press ENTER 
Copy and paste the URL (from theopenphotoproject.org) here:  http://theopenphotoproject.org/?frob=*******************************************

Thanks!

Now the script gets to work downloading the information for your photos. It doesn't download the actual photos so it should be relatively fast.

Parsing URL for the token... OK
Fetching user id... OK
Fetching page 1... OK
  * Storing photo 6109695003 to fetched/6109695003.json... OK
  * Storing photo 6109694841 to fetched/6109694841.json... OK
  * Storing photo 6109694637 to fetched/6109694637.json... OK
  * Storing photo 6110240318 to fetched/6110240318.json... OK
  * Storing photo 6110240222 to fetched/6110240222.json... OK
  * Storing photo 6065502023 to fetched/6065502023.json... OK
Fetching page 2... OK

YAY

Now you've got a bunch of text files. These can be fed into our import tool to transfer all of your photos into your OpenPhoto account.

Don't worry, we'll have a nice web based GUI for all of this soon :).

Known issues

  1. Fetches URL of original photos, which only works for Flickr pro accounts.
  2. Flickr allows multiple licenses but OpenPhoto does not.
  3. Flickr has machine tags, do we implement something similar?
    • Proposal is to store them even if we don't do anything special with them
  4. Flickr has a place_id
    • Proposal is to store it as a tag flickr:place_id=xxxxxxx
  5. Flickr has a woe_id (http://developer.yahoo.com/geo/geoplanet/guide/concepts.html)
    • Proposal is to store it as a tag geo:woe_id=xxxxxxx
    • Since it's not Flickr specific (maybe Yahoo! specific) store it as a geo attribute
  6. How to deal with contacts and groups?
    • Proposal is to auto create two groups (friends and family) and add photos to the given group for permissions. The user can then add people to the group since we won't import the actual contacts. This way if a photo is to be shared with family, it still is once they add family members to their group.
Something went wrong with that request. Please try again.