Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Recipes

Notices

Reply
 
Thread Tools Search this Thread
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
Old 09-17-2025, 01:46 AM   #2
unkn0wn
Guru
unkn0wn understands the Henderson-Hasselbalch Equation.unkn0wn understands the Henderson-Hasselbalch Equation.unkn0wn understands the Henderson-Hasselbalch Equation.unkn0wn understands the Henderson-Hasselbalch Equation.unkn0wn understands the Henderson-Hasselbalch Equation.unkn0wn understands the Henderson-Hasselbalch Equation.unkn0wn understands the Henderson-Hasselbalch Equation.unkn0wn understands the Henderson-Hasselbalch Equation.unkn0wn understands the Henderson-Hasselbalch Equation.unkn0wn understands the Henderson-Hasselbalch Equation.unkn0wn understands the Henderson-Hasselbalch Equation.
 
Posts: 641
Karma: 85520
Join Date: May 2021
Device: kindle
Code:
def get_article_url(self, article):
        url = BasicNewsRecipe.get_article_url(self, article)
        if '/sports/' not in url:
            return url
        return None
unkn0wn is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Hacks kindle 4 - blacklist ale14 Amazon Kindle 12 06-14-2014 12:51 PM
Is the Onyx Boox i62 capable of reading RSS (subscribe to RSS feeds)? Ababakar Onyx Boox 3 11-08-2012 07:38 AM
Brewt's Blacklist brewt Deals and Resources (No Self-Promotion or Affiliate Links) 0 06-07-2010 11:00 AM


All times are GMT -4. The time now is 01:42 PM.


MobileRead.com is a privately owned, operated and funded community.