07-16-2017, 06:47 PM | #1 |
Member
Posts: 19
Karma: 10
Join Date: Jan 2014
Device: Android tablet + FBReader
|
What can be tested for oldest_article
Looking at the RSS I'm working up a recipe for, I don't see any date/time datum for the item:
Code:
</item> <item rdf:about="http://www.csmonitor.com/World/Europe/2017/0714/During-Trump-s-Paris-visit-Macron-positions-himself-as-intermediary-between-Europe-and-president"> <title>During Trump's Paris visit, ...</title> <link>http://www.csmonitor.com/World/Europe/2017/0714/During-Trump-s-Paris-visit-Macron-positions-himself-as-intermediary-between-Europe-and-president</link> <description><p>French President Emmanuel Macron invited President Trump and ...</description> </item> Code:
<time id="date-published" class="eza-publish_date outer_block all_caps" datetime="2017-07-14T10:40:02-04:00" title="Published: July 14, 2017 10:40 am EDT">July 14, 2017 </time> Thanks, Alan |
07-16-2017, 11:30 PM | #2 |
creator of calibre
Posts: 43,842
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
It needs a date, but you can always customize how the rss is converted into articles by re-implementing parse_feeds() in your recipe class.
|
Advert | |
|
07-17-2017, 11:09 AM | #3 |
Member
Posts: 19
Karma: 10
Join Date: Jan 2014
Device: Android tablet + FBReader
|
Okay, I guess that means learning a lot more Python than I've had to deal with so far. Are there any existing recipes that you recommend I look at for good examples of reworking parse_feeds()?
While I'm learning, I could try an alternate approach, and suggest to the RSS provider that they add a date/time to their feed. What would calibre need to see, a dc:date element, or something different? Thanks, Alan |
07-17-2017, 01:23 PM | #4 |
creator of calibre
Posts: 43,842
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Just look at the source code of the BasicNewsRecipe class. And the RSS standard specifies how to add timestamps to feed entries.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Download only unread/not-yet-downloaded article (i.e. be smarter then oldest_article) | sup | Recipes | 2 | 11-28-2013 04:10 AM |
oldest_article not working, all RSS items downloaded instead | khromov | Recipes | 3 | 07-09-2012 05:07 PM |
oldest_article issue | _reader | Recipes | 0 | 05-17-2012 05:35 PM |
how to increase the max_articles_per_feed &oldest_article | iray1991 | Recipes | 0 | 01-31-2012 08:16 PM |
oldest_article questions | lucina | Recipes | 2 | 06-08-2011 04:06 PM |