Created
August 8, 2012 07:07
-
-
Save Ruxton/3292990 to your computer and use it in GitHub Desktop.
Get original facebook avatar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 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