From b9fc4bbf6e3cb45f0bbb79a970e0d064a5596d08 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 19 Oct 2020 21:43:27 +0100 Subject: [PATCH] Modify mirrored news links --- newsdaemon.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/newsdaemon.py b/newsdaemon.py index 8caf27613..bcb3e4e32 100644 --- a/newsdaemon.py +++ b/newsdaemon.py @@ -488,14 +488,19 @@ def convertRSStoActivityPub(baseDir: str, httpPrefix: str, rssDescription = rssDescription.replace(']]>', '') rssDescription = '

' + rssDescription + '

' + mirrored = item[7] + postUrl = url + if mirrored and '://' in url: + postUrl = '/newsmirror/' + url.split('://')[1] + # add the off-site link to the description if rssDescription and not dangerousMarkup(rssDescription): rssDescription += \ - '
' + \ + '
' + \ translate['Read more...'] + '' else: rssDescription = \ - '' + \ + '' + \ translate['Read more...'] + '' # remove image dimensions @@ -517,7 +522,6 @@ def convertRSStoActivityPub(baseDir: str, httpPrefix: str, if not blog: continue - mirrored = item[7] if mirrored: if not createNewsMirror(baseDir, statusNumber, url, maxMirroredArticles):