add convert_to_FeedItem method
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing

This commit is contained in:
mitsuha_s 2022-05-29 20:38:49 +00:00
parent 51c9754ad8
commit ba2ff845d3

8
rss.py
View file

@ -14,7 +14,13 @@ class Feed():
class RssReader(): class RssReader():
def convert_to_FeedItem(self, item: dict) -> FeedItem: 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: def get_items(self, items: list) -> list:
list_items = [] list_items = []