From 0c7a2341dea06e73da4faaace4413397850e3bb7 Mon Sep 17 00:00:00 2001 From: Homer S Date: Sun, 5 Apr 2020 00:56:38 +0200 Subject: [PATCH] Obviously noone noticed it but: The script didn't post anything at all because some important lines were missing. I hope, I corrected everything necessary ... --- mastobot.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/mastobot.py b/mastobot.py index e16d58c..1b223b8 100644 --- a/mastobot.py +++ b/mastobot.py @@ -112,14 +112,21 @@ for account in transitions: # Output text to stdout respect. post it to Mastodon. print(mastodon_text) + try: + mastodon.status_post(mastodon_text, None, masto_media, True, None,spoiler_text="Twitter RT") + + except: + print(account['twitter_handle'] + " couldn't toot to fediverse!\n") + continue + # mastodon.status_post(mastodon_text, None, masto_media, True) time.sleep(2) # If there are new statuses for account update the "last_id" to the newest one. if statuses: - #print(account['twitter_handle'] + " : " + str(status.id)) - account['last_id'] = str(status.id) + print(account['twitter_handle'] + " : " + str(status.id)) + #account['last_id'] = str(status.id) # Write updated settings to json-file with open(settings_path, 'w') as fp: