fix twitter/mastodon interface (really)

This commit is contained in:
b3yond 2017-07-11 22:49:24 +02:00
parent b10090a449
commit a2f7b49c99

View file

@ -127,7 +127,7 @@ class RetweetBot(object):
# these lines. # these lines.
except twitter.error.TwitterError: except twitter.error.TwitterError:
print("[ERROR] probably you already retweeted this tweet.") print("[ERROR] probably you already retweeted this tweet.")
return () return None
except requests.exceptions.ConnectionError: except requests.exceptions.ConnectionError:
print("[ERROR] Bad Connection.") print("[ERROR] Bad Connection.")
sleep(10) sleep(10)
@ -165,7 +165,9 @@ class RetweetBot(object):
# Is the Text of the Tweet in the triggerlist? # Is the Text of the Tweet in the triggerlist?
if self.trigger.is_ok(status.text): if self.trigger.is_ok(status.text):
# Retweet status # 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 # save the id so it doesn't get crawled again
self.last_mention = status.id self.last_mention = status.id