RSS module #19

Merged
Miroslavsckaya merged 8 commits from feature_rss into master 2022-05-29 20:13:40 +00:00
Showing only changes of commit d7d7838eb5 - Show all commits

9
rss.py
View file

@ -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)