Compare commits
No commits in common. "master" and "v3.1.0" have entirely different histories.
@ -1,12 +1,23 @@
|
|||||||
version: '3.9'
|
version: '3.4'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
interaction:
|
perseveringbot-int:
|
||||||
build: ./interaction
|
build: ./interaction
|
||||||
container_name: vision_interaction
|
|
||||||
volumes:
|
volumes:
|
||||||
- ./interaction:/usr/src/app
|
- ./interaction:/usr/src/app
|
||||||
restart: unless-stopped
|
restart: always
|
||||||
|
environment:
|
||||||
|
- BOT_VERSION
|
||||||
|
- BEARER_TOKEN
|
||||||
|
- ACCESS_TOKEN
|
||||||
|
- ACCESS_TOKEN_SECRET
|
||||||
|
- API_TOKEN
|
||||||
|
- API_KEY_SECRET
|
||||||
|
perseveringbot-pos:
|
||||||
|
build: ./posting
|
||||||
|
volumes:
|
||||||
|
- ./posting:/usr/src/app
|
||||||
|
restart: always
|
||||||
environment:
|
environment:
|
||||||
- BOT_VERSION
|
- BOT_VERSION
|
||||||
- BEARER_TOKEN
|
- BEARER_TOKEN
|
||||||
@ -15,16 +26,3 @@ services:
|
|||||||
- API_TOKEN
|
- API_TOKEN
|
||||||
- API_KEY_SECRET
|
- API_KEY_SECRET
|
||||||
|
|
||||||
posting:
|
|
||||||
build: ./posting
|
|
||||||
container_name: vision_posting
|
|
||||||
volumes:
|
|
||||||
- ./posting:/usr/src/app
|
|
||||||
restart: unless-stopped
|
|
||||||
environment:
|
|
||||||
- BOT_VERSION
|
|
||||||
- BEARER_TOKEN
|
|
||||||
- ACCESS_TOKEN
|
|
||||||
- ACCESS_TOKEN_SECRET
|
|
||||||
- API_TOKEN
|
|
||||||
- API_KEY_SECRET
|
|
||||||
|
@ -32,17 +32,17 @@ def storeLastSeen(filename, lastSeen):
|
|||||||
def searchTweets(query):
|
def searchTweets(query):
|
||||||
print('Searching for tweets')
|
print('Searching for tweets')
|
||||||
lastSeen = getLastSeen(lastSeenFile)
|
lastSeen = getLastSeen(lastSeenFile)
|
||||||
tweets = api.search_tweets(query, since_id=lastSeen)
|
tweets = api.search(query, since_id=lastSeen)
|
||||||
return tweets
|
return tweets
|
||||||
|
|
||||||
def interactions():
|
def interactions():
|
||||||
tweets = searchTweets('persevering')
|
tweets = searchTweets('persevering')
|
||||||
|
for tweet in reversed(tweets):
|
||||||
if not tweets:
|
if not tweets:
|
||||||
print('No new tweets found.')
|
print('No new tweets found.')
|
||||||
return
|
return
|
||||||
for tweet in reversed(tweets):
|
|
||||||
if re.search('what is.*if not.*persevering',tweet.text.lower()):
|
if re.search('what is.*if not.*persevering',tweet.text.lower()):
|
||||||
if not tweet.text.lower().startswith('rt') and tweet.user != api.verify_credentials():
|
if not tweet.text.lower().startswith('rt') and tweet.user != api.me():
|
||||||
print(f'Tweet {tweet.text} by @{tweet.author.screen_name}', flush = True)
|
print(f'Tweet {tweet.text} by @{tweet.author.screen_name}', flush = True)
|
||||||
t = api.get_status(tweet.id)
|
t = api.get_status(tweet.id)
|
||||||
if not t.favorited:
|
if not t.favorited:
|
||||||
|
Loading…
Reference in New Issue
Block a user