From d7d7838eb5964aa9e79efed712bfcf800912c425 Mon Sep 17 00:00:00 2001 From: mitsuha_s Date: Sun, 29 May 2022 23:11:23 +0000 Subject: [PATCH] little codestyle changes --- rss.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/rss.py b/rss.py index 0f1d762..8389972 100644 --- a/rss.py +++ b/rss.py @@ -13,6 +13,11 @@ class Feed(): self.items = items class RssReader(): + def get_feed(self, url: str) -> Feed: + f = feedparser.parse(url) + items = self.__get_items(f.entries) + return Feed(url, items) + def __convert_to_feed_item(self, item: dict) -> FeedItem: if 'title' in item: title = item['title'] @@ -28,7 +33,3 @@ class RssReader(): list_items.append(self.__convert_to_feed_item(item)) return list_items - def get_feed(self, url: str) -> Feed: - f = feedparser.parse(url) - items = self.__get_items(f.entries) - return Feed(url, items)