From f6b59b4de8c206e7abab0c90edbdaa999da5619c Mon Sep 17 00:00:00 2001 From: spla Date: Wed, 15 Sep 2021 12:27:09 +0200 Subject: [PATCH] If post > 280 first tweet must be almost 280 characters --- mastotuit.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mastotuit.py b/mastotuit.py index a8eae8c..f75a10b 100644 --- a/mastotuit.py +++ b/mastotuit.py @@ -167,11 +167,12 @@ if __name__ == '__main__': if publish == 1: toot_text = str(title)+'\n' - toot_text += str(link) toot_text = cleanhtml(toot_text) toot_text = unescape(toot_text) + toot_text += '\n' + str(link) + '\n' + print("Tooting...") print(toot_text) @@ -191,8 +192,8 @@ if __name__ == '__main__': else: - toot_text1 = toot_text[:int(len(toot_text)/2)].rsplit(' ', 1)[0] - toot_text2 = toot_text[int(len(toot_text1)):] + toot_text1 = toot_text[:275].rsplit(' ', 1)[0] + ' (1/2)' + toot_text2 = toot_text[int(len(toot_text1)-6):] + ' (2/2)' try: