tracinginsights commited on
Commit
2023ef4
·
1 Parent(s): c50dfca

Testing home_timeline

Browse files
Files changed (1) hide show
  1. app.py +14 -13
app.py CHANGED
@@ -99,19 +99,20 @@ def auth(api_key,secret_api_key,access_token,secret_access_token):
99
  # use this to get user id https://tweeterid.com/
100
  while True:
101
  # get twitter user_id at https://tweeterid.com/ by typing username
102
- users = ["1568348454619070465", "1503789937245581315" ] # change this for prod
103
- for user in users:
104
- timeline = api.user_timeline(user_id=#"1568348454619070465", #testing case using englishgiuly,
105
- user,
106
- #["1503789937245581315","1568348454619070465" ], # tracing and englishgiuly accounts
107
- #["2755544640", "1030481714", "407048032","227265199","190632194", "149542215","127854979", "106170617"],
108
- count=5, tweet_mode="extended",)
109
- for tweet in timeline:
110
- if check_or_write('tweet.txt', " ".join(tweet.full_text.splitlines())):
111
- curr = bulk_trans(tweet.full_text)
112
- status = f"{curr[:254]} https://twitter.com/1/status/{tweet.id}" # each link is converted to 23 characters
113
- api.update_status(status) # doesn't matter what username we use
114
- print(tweet.full_text)
 
115
  time.sleep(60)
116
 
117
  auth(api_key,secret_api_key,access_token,secret_access_token)
 
99
  # use this to get user id https://tweeterid.com/
100
  while True:
101
  # get twitter user_id at https://tweeterid.com/ by typing username
102
+ timeline = api.home_timeline(count=20,trim_user=True,
103
+ include_entities=["2755544640", "1030481714", "407048032","227265199","190632194", "149542215","127854979", "106170617"],)
104
+ # increase count if more users are added
105
+ # timeline = api.user_timeline(user_id=#"1568348454619070465", #testing case using englishgiuly,
106
+ # user,
107
+ # #["1503789937245581315","1568348454619070465" ], # tracing and englishgiuly accounts
108
+ # #["2755544640", "1030481714", "407048032","227265199","190632194", "149542215","127854979", "106170617"],
109
+ # count=5, tweet_mode="extended",)
110
+ for tweet in timeline:
111
+ if check_or_write('tweet.txt', " ".join(tweet.full_text.splitlines())):
112
+ curr = bulk_trans(tweet.full_text)
113
+ status = f"{curr[:254]} https://twitter.com/1/status/{tweet.id}" # each link is converted to 23 characters
114
+ api.update_status(status) # doesn't matter what username we use
115
+ print(tweet.full_text)
116
  time.sleep(60)
117
 
118
  auth(api_key,secret_api_key,access_token,secret_access_token)