![]() |
#1 |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 27
Karma: 53696
Join Date: Nov 2012
Device: Sony PRS T-1
|
Different keep_only_tags and remove_tags for different feeds
Is it possible to have different keep_only_tags and remove_tags for different feeds?
What is used for short bulletin news articles in two of the feeds (ie. all of the content in the feeds) is used as "see also" teasers in full-size articles in other feeds. The recipe is here: https://github.com/steinarb/calibre-...ter/nrk.recipe The element in question, is: Code:
dict(name='article', attrs={'class':'teaser widget rich js-realtime emphasis-medium bulletin'}), Code:
(u'NRK Østlandssendingen', u'http://www.nrk.no/ostlandssendingen/siste.rss'), (u'NRK Nordland', u'http://www.nrk.no/nordland/siste.rss'), |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
No, it isn't. I suggest you implement postprocess_html() to remove the bad see also elements manually in your recipe.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 27
Karma: 53696
Join Date: Nov 2012
Device: Sony PRS T-1
|
Ok, thanks!
Is the feed available in the soup somehow? That would make identification simpler. If not, one possible ad-hoc rule would be to leave the elements alone if there is only one of them. This would leave the content alone in the feeds/sections where this element is content, and at least cut the clutter in the articles where the element is used as "see also". |
![]() |
![]() |
![]() |
Tags |
different rules per feed, news, recipe |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
getting rid of images: remove_tags has no effect? | Read&Write | Recipes | 2 | 06-26-2012 01:27 PM |
Priority between keep_only_tags and remove_tags | BruceBerry | Recipes | 1 | 11-19-2011 03:10 PM |
remove_tags does not work | JFS-NMF | Recipes | 1 | 03-04-2011 01:56 PM |
keep_only_tags and findAll | boocko | Recipes | 3 | 11-18-2010 11:59 AM |
keep_only_tags | ultimatebuster | Calibre | 4 | 03-19-2010 07:49 PM |