add a date display in update sent to the user
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing

This commit is contained in:
mitsuha_s 2022-06-12 22:52:16 +00:00
parent 82641cc655
commit 42de1efed1
2 changed files with 6 additions and 2 deletions

5
rss.py
View file

@ -6,7 +6,10 @@ class FeedItem:
self.url = item.get('link', '') self.url = item.get('link', '')
self.title = item.get('title', '') self.title = item.get('title', '')
self.description = item.get('summary', '') self.description = item.get('summary', '')
self.date = item.get('published', '') if 'published' in item:
self.date = item.published_parsed()
else:
self.date = ''
class Feed: class Feed:
def __init__(self, url: str, feed: FeedParserDict) -> None: def __init__(self, url: str, feed: FeedParserDict) -> None:

View file

@ -123,7 +123,8 @@ class Notifier:
def __format_message(item: FeedItem) -> str: def __format_message(item: FeedItem) -> str:
return ( return (
f"<strong><a href=\"{item.url}\">{item.title}</a></strong>\n\n" f"<strong><a href=\"{item.url}\">{item.title}</a></strong>\n\n"
f"{item.description}" f"{item.description}\n"
f"{item.date}"
) )