-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTimelineGeo.py
More file actions
28 lines (24 loc) · 749 Bytes
/
TimelineGeo.py
File metadata and controls
28 lines (24 loc) · 749 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import tweepy, time, sys, json, re
from tweepy import OAuthHandler
from tweepy.api import API
from sys import argv
CONSUMER_KEY = 'xxx'
CONSUMER_SECRET = 'xxx'
ACCESS_KEY = 'xxx'
ACCESS_SECRET = 'xxx'
auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
auth.set_access_token(ACCESS_KEY, ACCESS_SECRET)
api = tweepy.API(auth)
c = tweepy.Cursor(api.home_timeline).items()
def cata(wait = 10):
tweet = c.next()
print ('@%s Location: %s %s Client: %s Created: %s %s\n' % (tweet.user.screen_name, str(tweet.geo), tweet.user.profile_image_url, tweet.source, tweet.created_at, tweet.text))
wait = time.sleep(wait)
return 0
while True:
try:
cata()
except:
pass