Spaces:
Runtime error
Runtime error
Commit
·
c18e18b
1
Parent(s):
7eb7452
Update app.py
Browse files
app.py
CHANGED
@@ -99,16 +99,19 @@ 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 |
time.sleep(60)
|
113 |
|
114 |
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 = ["1503789937245581315","1568348454619070465" ] # 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)
|