summaryrefslogtreecommitdiff
path: root/rss.py
diff options
context:
space:
mode:
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,