Last active
December 11, 2015 21:59
-
-
Save fmasanori/4666602 to your computer and use it in GitHub Desktop.
Python 3.x Twitter Profile Photo
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
# | |
# API DEPRECATED AT JUNE 2013 | |
# https://dev.twitter.com/docs/faq#17750 | |
# | |
import urllib.request | |
import json | |
url = 'https://api.twitter.com/1/users/profile_image?screen_name=' | |
user = 'fmasanori' | |
size = '&size=bigger' | |
resp = urllib.request.urlopen(url+user+size).read() | |
arquivo = 'Foto perfil '+user+'.jpg' | |
f = open(arquivo, 'wb') | |
f.write(resp) | |
f.close() | |
print (arquivo, 'gravado no diretório atual...') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Python rulz! #cpbr6