diff options
-rwxr-xr-x | rss.py | 19 |
1 files changed, 18 insertions, 1 deletions
@@ -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, |