summaryrefslogtreecommitdiff
path: root/rss.py
diff options
context:
space:
mode:
authorAndré Glüpker <git@wgmd.de>2021-07-29 10:44:16 +0200
committerAndré Glüpker <git@wgmd.de>2021-07-29 10:44:16 +0200
commit10556bfe0f591b4bcf63128ce90f52a5f1ccd140 (patch)
tree7fd31192e97330928c779b33877d93a2d302ae13 /rss.py
parent4b0a75b85d1892e04230de828fe09b90d4f73f09 (diff)
downloadrss-feeds-10556bfe0f591b4bcf63128ce90f52a5f1ccd140.tar.gz
rss-feeds-10556bfe0f591b4bcf63128ce90f52a5f1ccd140.tar.bz2
rss-feeds-10556bfe0f591b4bcf63128ce90f52a5f1ccd140.zip
Fix RSS Syntax Issues
Diffstat (limited to 'rss.py')
-rwxr-xr-xrss.py19
1 files changed, 18 insertions, 1 deletions
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,