add get_feed method
This commit is contained in:
parent
7e96992c7f
commit
1dd2ccfc6e
9
rss.py
9
rss.py
|
@ -5,8 +5,7 @@ class FeedItem():
|
|||
pass
|
||||
|
||||
class Feed():
|
||||
def __init__(self, title: str, url: str, items: list) -> None:
|
||||
self.title = title
|
||||
def __init__(self, url: str, items: list) -> None:
|
||||
self.url = url
|
||||
self.items = items
|
||||
|
||||
|
@ -18,6 +17,6 @@ class RssReader():
|
|||
pass
|
||||
|
||||
def get_feed(self, url: str) -> Feed:
|
||||
pass
|
||||
|
||||
|
||||
f = feedparser.parse(url)
|
||||
items = self.get_items(f.entries)
|
||||
return Feed(url, items)
|
||||
|
|
Loading…
Reference in a new issue