Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Get the photos you liked in facebook.
import facebook
token = '<TOKEN_HERE>'
graph = facebook.GraphAPI(token)
query = {'objects': 'SELECT object_id FROM like WHERE user_id = me() AND object_type = "photo"',
'likes': 'SELECT owner, src_big, link, created FROM photo WHERE object_id IN (SELECT object_id from #objects)'}
likes = graph.fql(query)[1]['fql_result_set']
with open('test.html', 'w') as f:
for like in likes:
f.write('<img src="%s"><br /><br />' % (like['src_big']))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment