debug interaction tweet search

This commit is contained in:
Vivek Santayana 2021-11-11 10:19:59 +00:00
parent 5d570394c0
commit 08d4d66493

View File

@ -37,10 +37,10 @@ def searchTweets(query):
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.me(): 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)