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, json | |
def busca_tweets(texto='python'): | |
url = 'http://search.twitter.com/search.json?q=' + texto | |
resp = urllib.urlopen(url).read() | |
data = json.loads(resp) |
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, json | |
def trend_topics(): | |
url = 'https://api.twitter.com/1/trends/1.json' | |
resp = urllib.urlopen(url).read() |
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 | |
url = 'https://graph.facebook.com/19292868552' | |
resp = urllib.urlopen(url).read() | |
data = json.loads(resp) | |
url_logo = data['cover']['source'] | |
imagem = urllib.urlopen(url_logo).read() |
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() |
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 json | |
import urllib | |
url = 'http://www.reddit.com/r/Python/.json' | |
resp = urllib.urlopen(url).read() | |
parsed = json.loads(resp) | |
for item in parsed['data']['children']: | |
doc = item['data'] |
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 json | |
import urllib | |
import pymongo | |
con = pymongo.Connection('mongodb://localhost', | |
safe = True) | |
db = con.reddit | |
stories = db.stories | |
url = 'http://www.reddit.com/r/Python/.json' |
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 | |
def busca_tweets(texto='python'): | |
url = 'http://search.twitter.com/search.json?q=' + texto |
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' |
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 | |
def trend_topics(): | |
url = 'https://api.twitter.com/1/trends/1.json' | |
resp = urllib.request.urlopen(url).read() |
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 = 'http://api.twitter.com/1/followers/ids.json?screen_name=fmasanori' | |
resp = urllib.request.urlopen(url).read() | |
flws = json.loads(resp.decode('utf-8')) |
OlderNewer