Skip to content

Instantly share code, notes, and snippets.

@Ruxton
Created August 8, 2012 07:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ruxton/3292990 to your computer and use it in GitHub Desktop.
Save Ruxton/3292990 to your computer and use it in GitHub Desktop.
Get original facebook avatar
## I have a member class, it has a method on it called facebook, you will also need the user_photos permission
#
# def facebook
# @facebook ||= Koala::Facebook::API.new facebook_auth.credentials.token if facebook?
# end
#
##
user=User.last
result = user.facebook.fql_multiquery({
"query1" => "SELECT object_id FROM album WHERE owner = me() and type='profile'",
"query2" => "SELECT cover_object_id FROM album WHERE object_id IN (SELECT object_id FROM #query1)"
})
user.facebook.get_picture(result['query2'][0]['cover_object_id'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment