RUBY - Facebook API - Download Photo Albums

Closed - This job posting has been filled and work has been completed.

Job Description

I have a facebook app that get's the user's "user_photos" permission.

I need a simple script that will download all pictures from all photo albums of a facebook user.
Preferably you will use this gem:

The script will be run like this:
ruby fb_download.rb HERE_THE_CODE

As you can see, I will pass the authorization code to the script as ARGV[0].

I did some work myself, see below:

require "rubygems"
require "fb_graph"

APP_ID = "..."
APP_SECRET = "...."
CODE = ARGV[0].strip # this is what Facebook will return after the user installs the App.. this is no access token

# Get Access Token:
fb_auth =, APP_SECRET)
client = fb_auth.client
client.redirect_uri = "..." # this must match 100% with the redirect_uri when the user installs the app

client.authorization_code = CODE
access_token = client.access_token! :client_auth_body

user =
user = user.fetch

# Download Albums
user.albums.each do |album| do |photo|
# ???