Created
March 3, 2015 10:16
-
-
Save alfcrisci/8a8e9a5e2853c87945b8 to your computer and use it in GitHub Desktop.
This file contains 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 io, json | |
from TwitterAPI import TwitterAPI | |
CONSUMER_KEY = '' | |
CONSUMER_SECRET = '' | |
ACCESS_TOKEN_KEY = '' | |
ACCESS_TOKEN_SECRET = '' | |
api = TwitterAPI(CONSUMER_KEY, | |
CONSUMER_SECRET, | |
ACCESS_TOKEN_KEY, | |
ACCESS_TOKEN_SECRET) | |
TRACK_TERM = 'meteo' | |
r = api.request('statuses/filter', {'track': TRACK_TERM}) | |
for item in r: | |
file=str(item['id_str'])+'.json' | |
with io.open( file, 'w', encoding='utf-8') as f: | |
f.write(unicode(json.dumps(item, ensure_ascii=False))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment