Hi Everyone,
I have a local newspaper that lists all sections in the same feed:
http://www.mahopacnews.com/rssheadlines.xml
I have the following recipe to grab the articles
However I get all the articles in one section. I would like to split the articles into their appropriate sections (News, Sports, Opinions, etc). On the feed page each article has the appropriate section name at the beginning of the article title. Eample:
News: Wild guest wows Mahopac Middle School students
News: Can Rotary Dream Team beat Harlem Magic Masters this year on March 11?
Opinion: Dressing for the next ice age
I added the following to the recipe which allowed me to filter the articles based upon a key word in the title:
Code:
def get_article_url(self, article):
link = article.get('link')
title = article.get('title')
if 'News:' in title:
return link
Is there a way to modify this so Calibre will run this on each key word then separate the articles into their appropriate sections?