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: