View Single Post
Old 09-15-2025, 06:27 PM   #1
OneOrTwo
Junior Member
OneOrTwo began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Oct 2024
Device: Kindle Oasis 2
Use RSS as a blacklist

I use a few RSS feeds from ABC (australia), but I don't want sport articles. I'm trying to use the rss feed for the sport articles as a blacklist so if the articles appear in any other feed they won't be downloaded. Can't get it to work, here's what I've done:

Code:
def parse_feeds(self):
    exclude_feed = self.index_to_soup('https://www.abc.net.au/news/feed/2942460/rss.xml')
    exclude_urls = {item.find('link').string for item in exclude_feed.findAll('item') if item.find('link')}

    feeds = BasicNewsRecipe.parse_feeds(self)
    for feed in feeds:
        feed.articles = [art for art in feed.articles if not art.url in exclude_urls]
    return feeds
Has anyone else done this before?
OneOrTwo is offline   Reply With Quote