Fixed slightly wrong logic.
This commit is contained in:
Oscar Domingo 2021-10-16 13:58:41 +00:00
pare e2588a6ecc
commit 1d8fb19731

Veure arxiu

@ -51,9 +51,6 @@ def get_toot(title):
return tuit_text
def compose_tweet(tuit_text, with_images, is_reply):
tuit_max_length = 250 if len(tuit_text) > 280 else 275
tuit_text2 = ''
images_ids = []
if with_images:
@ -92,10 +89,11 @@ def compose_tweet(tuit_text, with_images, is_reply):
sys.exit(err)
# Compose tuit
tuit_text2 = ''
if len(tuit_text) > 280:
tuit_max_length = 250 if with_images else 275
# This means that the OG tweet is bigger than 280
# Thus we need to break it down in two
if tuit_max_length == 250:
tuit_text = '{0} (1/2)'.format(
tuit_text[:tuit_max_length].rsplit(' ', 1)[0]
)