09-21-2011, 11:44 PM | #1 |
Junior Member
Posts: 4
Karma: 10
Join Date: Sep 2011
Location: Montevideo, Uruguay
Device: Kindle3
|
Duplicated news in recipe with multiple feeds
Hello everybody,
I have a question about the configuration of recipes. There's a site that has an RSS file for each tag/topic used in the articles. In my recipe I added some feeds for the topics i'm interested in. The problem is an article has many tags, so it can be in two or more feeds and the article will be twice (or three times, or four...) Is it possible to remove the duplicated articles from the recipes? This is my code: Code:
class AdvancedUserRecipe1316656601(BasicNewsRecipe): title = u'Mongabay' oldest_article = 120 max_articles_per_feed = 100 auto_cleanup = True remove_tags = [dict(name='p', attrs={'class':'hide'})] feeds = [(u'Amazon', u'http://news.mongabay.com/xml/amazon1.xml'), (u'Species discovery', u'http://news.mongabay.com/xml/species_discovery1.xml'), (u'Rainforest animals', u'http://news.mongabay.com/xml/rainforest%20animals1.xml'), (u'Cats', u'http://news.mongabay.com/xml/cats1.xml'), (u'Pantanal', u'http://news.mongabay.com/xml/pantanal1.xml')] def print_version(self, url): return url.replace('http://', 'http://print.') An example could be: the feed titled 'Amazon' has an article that also is in 'Rainforest animals'. What I want is to have only one of those duplicated articles. Is that possible? Any help will be appreciated. |
09-22-2011, 04:26 PM | #2 | |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
|
|
Advert | |
|
09-22-2011, 08:50 PM | #3 |
Junior Member
Posts: 4
Karma: 10
Join Date: Sep 2011
Location: Montevideo, Uruguay
Device: Kindle3
|
Thank you Starson for your answer.
I'll take a look at the thread. I have a lot to learn Thanks again! |
09-26-2011, 11:34 PM | #4 |
Junior Member
Posts: 4
Karma: 10
Join Date: Sep 2011
Location: Montevideo, Uruguay
Device: Kindle3
|
I used Pahan's code to get rid of already downloaded items and also filtered the code, but I couldn't resolve the main problem: not to get repeated articles from different feeds in the same run. I've been spending some time with this without success.
Though I've done some things in PHP for websites, I couldn't say I'm a programmer, so I will try a little more, and in case of failing again, I'll have to skip the articles in the kindle while reading Regards. PS: that's my code now: Spoiler:
|
03-14-2012, 06:26 PM | #5 |
Member
Posts: 24
Karma: 140
Join Date: Sep 2011
Device: Nook Color (rooted?)
|
Did you ever find a solution for removing duplicates from multiple feeds in the same run? If so, is it re-usable code?
I've tried using the code adapted from the NewScientist below Code:
... filterDuplicates = True url_list = [] ... def print_version(self, url): if self.filterDuplicates: if url in self.url_list: return return url.replace('/article/', '/printarticle/') Last edited by adoucette; 03-14-2012 at 09:27 PM. |
Advert | |
|
09-24-2012, 09:27 PM | #6 |
Junior Member
Posts: 4
Karma: 10
Join Date: Sep 2011
Location: Montevideo, Uruguay
Device: Kindle3
|
Sorry for the late response, but unfortunately I couldn't find a solution. Last months I've been very busy to do some research.
Now I'm skipping the duplicated articles as I read. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Multiple Kindles, Multiple News Feeds | filmprof | Recipes | 10 | 02-20-2012 10:38 AM |
option to add multiple custom OPDS feeds | ilovejedd | EPUBReader | 2 | 09-17-2011 02:18 PM |
Multiple News Feeds Problem on Kindle | Mixx | Calibre | 4 | 05-28-2011 05:02 PM |
Displaying Multiple RSS Feeds in a Single Section? | commandercup | Recipes | 5 | 03-01-2011 05:34 PM |
One Recipe, Multiple Feeds, Different Printer-Friendly Subs | DTM | Recipes | 9 | 02-11-2011 01:04 PM |