Browse Source

putting soup info under source

master
Andreas Demmelbauer 6 years ago
parent
commit
a8e30c9ad7
1 changed files with 3 additions and 4 deletions
  1. +3
    -4
      tootbot.py

+ 3
- 4
tootbot.py View File

@@ -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("<small>", "<br><small>"))
# 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)



Loading…
Cancel
Save