scan feeds from file
This commit is contained in:
@@ -103,6 +103,15 @@ class SubStackTask:
|
||||
|
||||
LOG.info("Running daily task : " + str(title_post))
|
||||
|
||||
ff = r'/data/feeds.txt'
|
||||
self.feeds = []
|
||||
with open(ff) as file:
|
||||
lines = [line.rstrip() for line in file]
|
||||
|
||||
for line in lines:
|
||||
youtube = "youtube" in line
|
||||
self.feeds.append(RSSfeed(line, youtube))
|
||||
|
||||
sub_stack_post = Post(
|
||||
title=title_post,
|
||||
subtitle="",
|
||||
@@ -117,7 +126,7 @@ class SubStackTask:
|
||||
all_news_posts = []
|
||||
|
||||
for feed in self.feeds:
|
||||
|
||||
LOG.info("Scanning feed " + feed.url)
|
||||
html_text = requests.get(feed.url).text
|
||||
newsFeed = feedparser.parse(html_text)
|
||||
|
||||
@@ -200,16 +209,13 @@ async def main(login, password, account):
|
||||
|
||||
feeds = []
|
||||
|
||||
feeds.append(RSSfeed("https://www.factornews.com/rss.xml"))
|
||||
feeds.append(RSSfeed("https://nofrag.com/feed"))
|
||||
feeds.append(RSSfeed("https://dystopeek.fr/feed/"))
|
||||
feeds.append(RSSfeed("https://thepixelpost.com/rss/"))
|
||||
feeds.append(RSSfeed("https://yamukass.substack.com/feed"))
|
||||
feeds.append(RSSfeed("https://tseret.com/categorie/tests/feed"))
|
||||
feeds.append(RSSfeed("https://www.gamesidestory.com/feed"))
|
||||
feeds.append(RSSfeed("https://www.nintendo-town.fr/feed"))
|
||||
feeds.append(RSSfeed("https://www.youtube.com/feeds/videos.xml?channel_id=UC-OvBDfZGn1OdsqMBwkOI_A", True))
|
||||
feeds.append(RSSfeed("https://www.youtube.com/feeds/videos.xml?playlist_id=PLZRiqJjIUlDTrwYs_UqEIts5fVaBpaIEz", True))
|
||||
ff = r'/data/feeds.txt'
|
||||
with open(ff) as file:
|
||||
lines = [line.rstrip() for line in file]
|
||||
|
||||
for line in lines:
|
||||
youtube = "youtube" in line
|
||||
feeds.append(RSSfeed(line, youtube))
|
||||
|
||||
task = SubStackTask(login, password, account, feeds)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user