Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import urllib.request
- import json
- '''
- 1. Install Python 3.x (batteries included yay)
- 2. Log into https://developers.facebook.com/docs/reference/api/
- 3. Copy Friends Link with access_token
- 4. Run
- Obs.: try advanced hacking in this links
- https://github.com/facebook/python-sdk
- https://github.com/facebook/fbconsole
- https://github.com/finiteloop/socialcookbook
- '''
- def get_friends():
- url = 'Paste Friends Link here with your access_token'
- resp = urllib.request.urlopen(url).read()
- data = json.loads(resp.decode('utf-8'))
- return data['data']
- def picture(id_friend):
- url = 'https://graph.facebook.com/'+ id_friend + '/picture?type=large'
- return urllib.request.urlopen(url).read()
- def download_pics(friends):
- for f in friends:
- print (f['name'])
- file = open (f['name']+'.jpg', 'wb')
- file.write(picture(f['id']))
- file.close()
- download_pics(get_friends())
Add Comment
Please, Sign In to add comment