Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import tweetstream
- uname = 'xxxxxxx'
- passwd = 'xxxxxxxxx'
- extent =["144.0,-39.0,146.0,-37.0"]
- # while True loop to keep reconnecting after a ConnectionError.
- while True:
- try:
- with tweetstream.FilterStream(uname, passwd, locations=extent) as stream:
- for tweet in stream:
- if "coordinates" in tweet and tweet["coordinates"]:
- print tweet["coordinates"]
- except tweetstream.ConnectionError as e:
- pass
Advertisement
Add Comment
Please, Sign In to add comment