feedgenerator

A simple tool to create various feeds
git clone https://git.ortlepp.eu/feedgenerator.git/
Log | Files | Refs | README | LICENSE

commit 2a40cc6576bb204d8b81bccd1dcde647502142a1
parent a8bed134192679ded4c633bfbc7f071369fe4a02
Author: Thorsten Ortlepp <post@ortlepp.eu>
Date:   Tue,  4 Jan 2022 23:09:03 +0100

Improvements for feed generation

Diffstat:
Mantenne_muenster.py | 5++++-
Mcommon.py | 2+-
2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/antenne_muenster.py b/antenne_muenster.py @@ -39,8 +39,11 @@ class AntenneMuensterFeed(): def __parse_title(self, string): + string = string.strip() + if string.endswith("."): + string = string[0:len(string) - 1] if string.find("Uhr:") == -1: - return string.strip() + return string else: return string.split("Uhr:")[1].strip() diff --git a/common.py b/common.py @@ -69,7 +69,7 @@ class AtomFeed: def __feed_item(self, item): atom_title = self.__create_element("title", item.get_title()) atom_link = self.__create_element("link", "href", item.get_url()) - atom_id = self.__create_element("id", "urn:uuid:" + hashlib.sha256(item.get_title().encode()).hexdigest()) + atom_id = self.__create_element("id", "urn:uuid:" + hashlib.sha256(item.get_title().lower().encode()).hexdigest()) atom_author = self.__create_element("author", self.__create_element("name", item.get_author())) atom_updated = self.__create_element("updated", self.__format_datetime(item.get_date())) atom_content = self.__create_element("content", html.escape(item.get_content()), "type", "html")