Thibault Goehringer
commited on
Commit
·
0a19f94
1
Parent(s):
c2a9502
Clean things up
Browse files
main.py
CHANGED
@@ -17,6 +17,10 @@ access_token = os.environ.get("access_token")
|
|
17 |
access_token_secret = os.environ.get("access_token_secret")
|
18 |
bearer_token = os.environ.get("bearer_token")
|
19 |
|
|
|
|
|
|
|
|
|
20 |
client = tweepy.Client(
|
21 |
bearer_token=bearer_token,
|
22 |
consumer_key=consumer_key,
|
@@ -74,7 +78,7 @@ def toast(text):
|
|
74 |
|
75 |
|
76 |
def reply_to_mentions():
|
77 |
-
since_id = get_last_tweet(
|
78 |
mentions = client.get_users_mentions(
|
79 |
id=1612106815096999936,
|
80 |
since_id=since_id,
|
@@ -118,7 +122,7 @@ def reply_to_mentions():
|
|
118 |
logger.error(e)
|
119 |
continue
|
120 |
|
121 |
-
put_last_tweet(
|
122 |
|
123 |
|
124 |
def main():
|
|
|
17 |
access_token_secret = os.environ.get("access_token_secret")
|
18 |
bearer_token = os.environ.get("bearer_token")
|
19 |
|
20 |
+
home_path = os.environ.get("HOME")
|
21 |
+
last_id_filepath = home_path + "/app/last_id.txt"
|
22 |
+
|
23 |
+
|
24 |
client = tweepy.Client(
|
25 |
bearer_token=bearer_token,
|
26 |
consumer_key=consumer_key,
|
|
|
78 |
|
79 |
|
80 |
def reply_to_mentions():
|
81 |
+
since_id = get_last_tweet(last_id_filepath)
|
82 |
mentions = client.get_users_mentions(
|
83 |
id=1612106815096999936,
|
84 |
since_id=since_id,
|
|
|
122 |
logger.error(e)
|
123 |
continue
|
124 |
|
125 |
+
put_last_tweet(last_id_filepath, mention.id)
|
126 |
|
127 |
|
128 |
def main():
|