add a date display in update sent to the user
This commit is contained in:
parent
82641cc655
commit
42de1efed1
5
rss.py
5
rss.py
|
@ -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:
|
||||||
|
|
|
@ -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}"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue