Thread: Break up feed
View Single Post
Old 01-09-2010, 05:52 PM   #1
BrianG
Member
BrianG began at the beginning.
 
Posts: 23
Karma: 22
Join Date: Dec 2009
Device: Kindle DX
Break up feed

I'm working on a recipe for Reader's Digest, and I ran into an issue that is beyond my abilities. Hoping to find some recipe/Python suggestions.

There's one large "main" feed that I have included in the FEEDS part of the recipe. There's no problem creating or formatting the actual articles into content that's useable by Calibre, but there is one wrinkle: the individual articles are one of two things:

1) Typical RD stories that I'd be interested in reading
2) A bunch of cooking recipes (like for muffins, etc.) that are not that interesting to me.

I was looking at the documentation on the BasicNewsRecipe, and couldn't find exactly what I was hoping for. I wanted to do any one of a few things:


Ideally, I'd like to divide this feed into two "logical feeds" with two separate sections in the TOC. I'd want to programatically read the big feed and take action based on the name of the article (e.g. if it has the word "recipe" in it).

I'd like to take something like:

MAIN FEED
article1
article2
recipe1
article3
recipe2

and have it show up in the TOC as:

MAIN
article1
article2
article3

RECIPES
recipe1
recipe2


If the methods aren't there to easily do this, I wouldn't mind ordering the articles (regardless of feed retrieval order) in the same section like:

MAIN
article1
article2
article3
recipe1
recipe2



Or ... if all else fails, I'd like to add code to find the title of the URL that is passed into my existing print_version method and if it contains the word "recipe" I'd like to null out the URL (or whatever it takes) to skip the article all-together.



Does anyone have any ideas about which methods might help a Python
n00B with any of these manipulations?


thanks...
BrianG is offline   Reply With Quote