Spaces:
Runtime error
Runtime error
Commit
·
2023ef4
1
Parent(s):
c50dfca
Testing home_timeline
Browse files
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 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
|
|
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)
|