Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Recipes

Notices

Reply
 
Thread Tools Search this Thread
Old 07-16-2017, 06:47 PM   #1
AlanRoberts
Member
AlanRoberts began at the beginning.
 
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>&lt;p&gt;French President Emmanuel Macron invited President Trump and ...</description>
  </item>
There is a time element within the article body that seems useful:
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>
Can I customize to make use of this element, or is oldest_article only applicable if the RDF contains a date?

Thanks,
Alan
AlanRoberts is offline   Reply With Quote
Old 07-16-2017, 11:30 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
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.
kovidgoyal is offline   Reply With Quote
Advert
Old 07-17-2017, 11:09 AM   #3
AlanRoberts
Member
AlanRoberts began at the beginning.
 
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
AlanRoberts is offline   Reply With Quote
Old 07-17-2017, 01:23 PM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
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.
kovidgoyal is offline   Reply With Quote
Reply


Forum Jump

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


All times are GMT -4. The time now is 04:15 AM.


MobileRead.com is a privately owned, operated and funded community.