Permalink
Cannot retrieve contributors at this time
executable file
17 lines (14 sloc)
378 Bytes
#!/usr/bin/env python | |
""" | |
Filter tweets/retweets that have geocoding. | |
""" | |
from __future__ import print_function | |
import json | |
import fileinput | |
for line in fileinput.input(): | |
tweet = json.loads(line) | |
if 'retweeted_status' in tweet: | |
if tweet['retweeted_status']['geo']: | |
print(json.dumps(tweet)) | |
elif tweet['geo']: | |
print(json.dumps(tweet)) |