Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
ff1072e243 | |||
08d4d66493 | |||
5d570394c0 | |||
bb298e5f9f | |||
4a7f15b658 | |||
4102231b72 |
@ -1,11 +1,12 @@
|
||||
version: '3.4'
|
||||
version: '3.9'
|
||||
|
||||
services:
|
||||
perseveringbot-int:
|
||||
interaction:
|
||||
build: ./interaction
|
||||
container_name: vision_interaction
|
||||
volumes:
|
||||
- ./interaction:/usr/src/app
|
||||
restart: always
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- BOT_VERSION
|
||||
- BEARER_TOKEN
|
||||
@ -13,11 +14,13 @@ services:
|
||||
- ACCESS_TOKEN_SECRET
|
||||
- API_TOKEN
|
||||
- API_KEY_SECRET
|
||||
perseveringbot-pos:
|
||||
|
||||
posting:
|
||||
build: ./posting
|
||||
container_name: vision_posting
|
||||
volumes:
|
||||
- ./posting:/usr/src/app
|
||||
restart: always
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- BOT_VERSION
|
||||
- BEARER_TOKEN
|
||||
@ -25,4 +28,3 @@ services:
|
||||
- ACCESS_TOKEN_SECRET
|
||||
- API_TOKEN
|
||||
- API_KEY_SECRET
|
||||
|
@ -32,17 +32,17 @@ def storeLastSeen(filename, lastSeen):
|
||||
def searchTweets(query):
|
||||
print('Searching for tweets')
|
||||
lastSeen = getLastSeen(lastSeenFile)
|
||||
tweets = api.search(query, since_id=lastSeen)
|
||||
tweets = api.search_tweets(query, since_id=lastSeen)
|
||||
return tweets
|
||||
|
||||
def interactions():
|
||||
tweets = searchTweets('persevering')
|
||||
if not tweets:
|
||||
print('No new tweets found.')
|
||||
return
|
||||
for tweet in reversed(tweets):
|
||||
if not tweets:
|
||||
print('No new tweets found.')
|
||||
return
|
||||
if re.search('what is.*if not.*persevering',tweet.text.lower()):
|
||||
if not tweet.text.lower().startswith('rt') and tweet.user != api.me():
|
||||
if not tweet.text.lower().startswith('rt') and tweet.user != api.verify_credentials():
|
||||
print(f'Tweet {tweet.text} by @{tweet.author.screen_name}', flush = True)
|
||||
t = api.get_status(tweet.id)
|
||||
if not t.favorited:
|
||||
|
Loading…
Reference in New Issue
Block a user