From 1dd2ccfc6eda4b2251049c7e1132f81198799432 Mon Sep 17 00:00:00 2001 From: mitsuha_s Date: Sun, 29 May 2022 20:25:07 +0000 Subject: [PATCH] add get_feed method --- rss.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/rss.py b/rss.py index 3aa4060..0dc074e 100644 --- a/rss.py +++ b/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)