fixed some last bugs, retweetbot.py should work again now.

This commit is contained in:
b3yond 2017-06-18 01:06:59 +02:00
parent a34c1d260f
commit 3f442e0f91
3 changed files with 6 additions and 9 deletions

View file

@ -1,5 +1,4 @@
kontrolle kontrolle
ticketfrei
konti konti
db db
zivil zivil
@ -11,7 +10,6 @@ bahn
tram tram
linie linie
nuernberg nuernberg
nbg
nürnberg nürnberg
s1 s1
s2 s2

View file

@ -122,12 +122,12 @@ class RetweetBot(object):
""" """
while 1: while 1:
try: try:
print self.api.PostRetweet(status.id) self.api.PostRetweet(status.id)
return self.format_mastodon(status) return self.format_mastodon(status)
# Hopefully we got rid of this error. If not, try to uncomment these lines. # maybe one day we get rid of this error. If not, try to uncomment 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.")
# done = True return None
except requests.exceptions.ConnectionError: except requests.exceptions.ConnectionError:
print("[ERROR] Bad Connection.") print("[ERROR] Bad Connection.")
sleep(10) sleep(10)
@ -169,7 +169,6 @@ class RetweetBot(object):
# 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
print self.last_mention # debug
# Return Retweets for tooting on mastodon # Return Retweets for tooting on mastodon
return mastodon return mastodon
@ -185,7 +184,7 @@ if __name__ == "__main__":
# create an Api object # create an Api object
bot = RetweetBot() bot = RetweetBot()
while True: while True:
sleep(10)
bot.flow() bot.flow()
sleep(10)
#except: #except:
# bot.shutdown() # bot.shutdown()

Binary file not shown.