Created
November 21, 2012 13:40
-
-
Save fmasanori/4124876 to your computer and use it in GitHub Desktop.
Facebook Download Friends Photos
This file contains hidden or 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
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