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 ...

This commit is contained in:
Homer S. 2020-04-05 00:56:38 +02:00
parent b1e44ae914
commit 0c7a2341de
1 changed files with 9 additions and 2 deletions

View File

@ -112,14 +112,21 @@ for account in transitions:
# Output text to stdout respect. post it to Mastodon. # Output text to stdout respect. post it to Mastodon.
print(mastodon_text) 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) # mastodon.status_post(mastodon_text, None, masto_media, True)
time.sleep(2) time.sleep(2)
# If there are new statuses for account update the "last_id" to the newest one. # If there are new statuses for account update the "last_id" to the newest one.
if statuses: if statuses:
#print(account['twitter_handle'] + " : " + str(status.id)) print(account['twitter_handle'] + " : " + str(status.id))
account['last_id'] = str(status.id) #account['last_id'] = str(status.id)
# Write updated settings to json-file # Write updated settings to json-file
with open(settings_path, 'w') as fp: with open(settings_path, 'w') as fp: