From 50f7e3f142d5c1a48a727769401511e094230481 Mon Sep 17 00:00:00 2001 From: Andreas Bielawski Date: Tue, 22 Nov 2016 12:49:16 +0100 Subject: [PATCH] =?UTF-8?q?-=20=C3=9Cbernehme=20ein=20paar=20=C3=84nderung?= =?UTF-8?q?en=20von=20@Akamaru=20-=20Fixe=20cleanRSS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bot.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/bot.py b/bot.py index c8bbf59..e953d4a 100644 --- a/bot.py +++ b/bot.py @@ -84,6 +84,7 @@ def cleanRSS(str): str = str.replace('Read more', '') str = str.replace('(more…)', '') str = str.replace('View On WordPress', '') + str = str.replace('Continue reading →', '') str = str.replace('(RSS generated with FetchRss)', '') str = str.replace('-- Delivered by Feed43 service', '') str = str.replace('Meldung bei www.tagesschau.de lesen', '') @@ -284,7 +285,7 @@ def check_rss(bot, job): if not 'title' in v2: title = 'Kein Titel' else: - title = v2.title + title = remove_tags(v2.title).lstrip() if not 'link' in v2: link = feed_data.feed.link link_name = link @@ -297,13 +298,13 @@ def check_rss(bot, job): link_name = urlparse(link).netloc link_name = re.sub('^www\d?\.', '', link_name) # www. if 'content' in v2: - content = cleanRSS(v2.content[0].value) - content = remove_tags(content).lstrip() + content = remove_tags(v2.content[0].value).lstrip() + content = cleanRSS(content) if len(content) > 250: content = content[0:250] + '...' elif 'summary' in v2: - content = cleanRSS(v2.summary) - content = remove_tags(content).lstrip() + content = remove_tags(v2.summary).lstrip() + content = cleanRSS(content) if len(content) > 250: content = content[0:250] + '...' else: