Skip to content

Instantly share code, notes, and snippets.

@fmasanori
Created November 21, 2012 13:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save fmasanori/4124876 to your computer and use it in GitHub Desktop.
Save fmasanori/4124876 to your computer and use it in GitHub Desktop.
Facebook Download Friends Photos
import urllib
import json
def grava_imagem(amigo):
url = 'https://graph.facebook.com/' + amigo['id'] + '/picture?type=large'
figura = urllib.urlopen(url).read()
f = open (amigo['name'] + '.jpg', 'wb')
f.write (figura)
f.close()
url = 'Paste Friends Link here'
resp = urllib.urlopen(url).read()
data = json.loads(resp)
for amigo in data['data']:
print (amigo['name'])
grava_imagem(amigo)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment