From 644d23b576d5dad5ffacf70175891182004a8d26 Mon Sep 17 00:00:00 2001 From: Andreas Bielawski Date: Tue, 22 Nov 2016 01:11:37 +0100 Subject: [PATCH] - Entferne Debugging-Output - Entferne www. im Link-Namen - Nutze Feedburner-Username bei Feedburner-Links --- bot.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bot.py b/bot.py index f8a10a4..c8bbf59 100644 --- a/bot.py +++ b/bot.py @@ -281,7 +281,6 @@ def check_rss(bot, job): newentr = get_new_entries(last, feed_data.entries) text = '' for k2, v2 in enumerate(newentr): - print(newentr) if not 'title' in v2: title = 'Kein Titel' else: @@ -291,7 +290,12 @@ def check_rss(bot, job): link_name = link else: link = v2.link - link_name = urlparse(link).netloc + f = re.search('^https?://feedproxy\.google\.com/~r/(.+?)/.*', link) # feedproxy.google.com + if f: + link_name = f.group(1) + else: + 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()