From 10556bfe0f591b4bcf63128ce90f52a5f1ccd140 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Gl=C3=BCpker?= Date: Thu, 29 Jul 2021 10:44:16 +0200 Subject: Fix RSS Syntax Issues --- rss.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'rss.py') diff --git a/rss.py b/rss.py index f11a956..8fbf6a2 100755 --- a/rss.py +++ b/rss.py @@ -1,6 +1,7 @@ #!/usr/bin/env python3 from datetime import datetime +from typing import List def _format_date(dt): """convert a datetime into an RFC 822 formatted date @@ -21,7 +22,23 @@ def _format_date(dt): "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"][dt.month-1], dt.year, dt.hour, dt.minute, dt.second) -def buildRSS(feed_data): +class RSSItem: + title: str + url: str + content: str + date: str + enclosures: List[str] + guid: str + + +class RSSFeed: + title: str + url: str + description: str + content: List[RSSItem] + + +def buildRSS(feed_data: RSSFeed): """ feed_data = { title, url, description, -- cgit v1.2.3