Spaces:
Runtime error
Runtime error
Commit
·
09de327
1
Parent(s):
662cf1d
change from full_text to text
Browse files
app.py
CHANGED
@@ -101,7 +101,7 @@ def auth(api_key,secret_api_key,access_token,secret_access_token):
|
|
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 |
-
|
105 |
# increase count if more users are added
|
106 |
# timeline = api.user_timeline(user_id=#"1568348454619070465", #testing case using englishgiuly,
|
107 |
# user,
|
@@ -109,11 +109,11 @@ def auth(api_key,secret_api_key,access_token,secret_access_token):
|
|
109 |
# #["2755544640", "1030481714", "407048032","227265199","190632194", "149542215","127854979", "106170617"],
|
110 |
# count=5, tweet_mode="extended",)
|
111 |
for tweet in timeline:
|
112 |
-
if check_or_write('tweet.txt', " ".join(tweet.
|
113 |
-
curr = bulk_trans(tweet.full_text
|
114 |
status = f"{curr[:254]} https://twitter.com/1/status/{tweet.id}" # each link is converted to 23 characters
|
115 |
api.update_status(status) # doesn't matter what username we use
|
116 |
-
print(tweet.full_text
|
117 |
time.sleep(60)
|
118 |
|
119 |
auth(api_key,secret_api_key,access_token,secret_access_token)
|
|
|
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 |
+
)
|
105 |
# increase count if more users are added
|
106 |
# timeline = api.user_timeline(user_id=#"1568348454619070465", #testing case using englishgiuly,
|
107 |
# user,
|
|
|
109 |
# #["2755544640", "1030481714", "407048032","227265199","190632194", "149542215","127854979", "106170617"],
|
110 |
# count=5, tweet_mode="extended",)
|
111 |
for tweet in timeline:
|
112 |
+
if check_or_write('tweet.txt', " ".join(tweet.text.splitlines())): #change from full_text to text
|
113 |
+
curr = bulk_trans(tweet.text) #change from full_text to text
|
114 |
status = f"{curr[:254]} https://twitter.com/1/status/{tweet.id}" # each link is converted to 23 characters
|
115 |
api.update_status(status) # doesn't matter what username we use
|
116 |
+
print(tweet.text) #change from full_text to text
|
117 |
time.sleep(60)
|
118 |
|
119 |
auth(api_key,secret_api_key,access_token,secret_access_token)
|