From a2f7b49c992eec2aa2d37b65c9e601850d3ba208 Mon Sep 17 00:00:00 2001 From: b3yond Date: Tue, 11 Jul 2017 22:49:24 +0200 Subject: [PATCH] fix twitter/mastodon interface (really) --- retweetbot.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/retweetbot.py b/retweetbot.py index 21c77f4..348c4d3 100644 --- a/retweetbot.py +++ b/retweetbot.py @@ -127,7 +127,7 @@ class RetweetBot(object): # these lines. except twitter.error.TwitterError: print("[ERROR] probably you already retweeted this tweet.") - return () + return None except requests.exceptions.ConnectionError: print("[ERROR] Bad Connection.") sleep(10) @@ -165,7 +165,9 @@ class RetweetBot(object): # Is the Text of the Tweet in the triggerlist? if self.trigger.is_ok(status.text): # Retweet status - mastodon.append(self.retweet(status)) + toot = self.retweet(status) + if toot: + mastodon.append(toot) # save the id so it doesn't get crawled again self.last_mention = status.id