diff --git a/interaction/script.py b/interaction/script.py index a47f2a2..907902e 100644 --- a/interaction/script.py +++ b/interaction/script.py @@ -37,10 +37,10 @@ def searchTweets(query): 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(): print(f'Tweet {tweet.text} by @{tweet.author.screen_name}', flush = True)