diff --git a/mastobot.py b/mastobot.py index c2ae3d4..e16d58c 100644 --- a/mastobot.py +++ b/mastobot.py @@ -104,6 +104,11 @@ for account in transitions: mastodon_text += "\n\nPosted " + parse(str(status.created_at)).strftime("%d. %B %Y - %H:%M on Twitter") mastodon_text += "\nOrigin: https://twitter.com/" + account['twitter_handle'] + "/status/" + tweet_origin + # Make sure that 500 char limit of Mastodon-API doesn't break the script + if len(mastodon_text) > 500: + mastodon_text = mastodon_text[:489] + + # Output text to stdout respect. post it to Mastodon. print(mastodon_text)