From ba2ff845d372500e0178e8473ef812a9edb25377 Mon Sep 17 00:00:00 2001 From: mitsuha_s Date: Sun, 29 May 2022 20:38:49 +0000 Subject: [PATCH] add convert_to_FeedItem method --- rss.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/rss.py b/rss.py index f54f9c0..375ea82 100644 --- a/rss.py +++ b/rss.py @@ -14,7 +14,13 @@ class Feed(): class RssReader(): def convert_to_FeedItem(self, item: dict) -> FeedItem: - pass + if 'title' in item: + title = item['title'] + if 'link' in item: + url = item['link'] + if 'summary' in item: + description = item['summary'] + return FeedItem(url, title, description) def get_items(self, items: list) -> list: list_items = []