From a8e30c9ad7e91a2c8715855039481e2599372398 Mon Sep 17 00:00:00 2001 From: Andreas Demmelbauer Date: Tue, 3 Apr 2018 09:27:43 -0700 Subject: [PATCH] putting soup info under source --- tootbot.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tootbot.py b/tootbot.py index cb0b349..3176776 100755 --- a/tootbot.py +++ b/tootbot.py @@ -247,7 +247,7 @@ for p in reversed(s.entries): print('Dryrun: not fetching ', pic, ' and not uploading it to mastodon') poster = p.title.split(']')[0].strip('[') - poster_text = "\n\nvia %s on soup.io" % poster + poster_text = "\n(via %s on soup.io)" % poster # remove all html stuff - python module in use only supports markdown, not pure plaintext textsrc = h.handle(p.summary_detail.value.replace("", "
")) # free text from lines without visible characters @@ -269,11 +269,10 @@ for p in reversed(s.entries): maximumlegth = 500 - 1 - len(poster_text) - len(source) - 50 # 50 ... just in case (if they also count attachement url and so on) text = (text[:maximumlegth] + '…') if len(text) > maximumlegth else text - # add poster - text += poster_text - # add source text += source + # add soup poster + text += poster_text print(text)