Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 09-16-2012, 09:32 AM   #1
drMerry
Addict
drMerry has become one with the cosmosdrMerry has become one with the cosmosdrMerry has become one with the cosmosdrMerry has become one with the cosmosdrMerry has become one with the cosmosdrMerry has become one with the cosmosdrMerry has become one with the cosmosdrMerry has become one with the cosmosdrMerry has become one with the cosmosdrMerry has become one with the cosmosdrMerry has become one with the cosmos
 
drMerry's Avatar
 
Posts: 293
Karma: 21022
Join Date: Mar 2011
Location: NL
Device: Sony PRS-650
Question Static files as recipe?

Hi,

I am wondering how I could implement the following.

There is a comic site that just updates the image of the day.
So they have seven files ma.png di.png wo.png do.png vr.png za.png and zo.png (the short names for the days of the week in dutch).
I want to make a recipe to download these files. But I do not have info about the date, and I don't know what day it is when the recipe runs.

So I wanted just to keep the files in order (always start with monday).
The recipe though needs a date to add an article.

How should I build such a recipe?
drMerry is offline   Reply With Quote
Old 09-16-2012, 10:54 AM   #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: 36,817
Karma: 16422153
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
why cant you just use today's date?

from datetime import date
d = date.today().weekday()
kovidgoyal is offline   Reply With Quote
Advert
Old 09-17-2012, 10:08 AM   #3
drMerry
Addict
drMerry has become one with the cosmosdrMerry has become one with the cosmosdrMerry has become one with the cosmosdrMerry has become one with the cosmosdrMerry has become one with the cosmosdrMerry has become one with the cosmosdrMerry has become one with the cosmosdrMerry has become one with the cosmosdrMerry has become one with the cosmosdrMerry has become one with the cosmosdrMerry has become one with the cosmos
 
drMerry's Avatar
 
Posts: 293
Karma: 21022
Join Date: Mar 2011
Location: NL
Device: Sony PRS-650
Sounds logical.
Thanks.

But then the next problem, there is no rss. As far as I can see, I can only add articles to an existing feed. (either by parsing a website or using a real rss feed).
So I should always start with a basic url right? Or can I just skip the parsing part and add the 7 images in a complete new feed. (Is there a recipe I could use as guide for this?)
drMerry is offline   Reply With Quote
Old 09-17-2012, 10:25 AM   #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: 36,817
Karma: 16422153
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I cant recall any recipe that does that, but the idea is simple, just implement parse index and return the appropriate object from it, as documented in the API documentation. Its up to you whether you want one image per section or one section with one image per article.
kovidgoyal is offline   Reply With Quote
Old 09-17-2012, 11:21 AM   #5
drMerry
Addict
drMerry has become one with the cosmosdrMerry has become one with the cosmosdrMerry has become one with the cosmosdrMerry has become one with the cosmosdrMerry has become one with the cosmosdrMerry has become one with the cosmosdrMerry has become one with the cosmosdrMerry has become one with the cosmosdrMerry has become one with the cosmosdrMerry has become one with the cosmosdrMerry has become one with the cosmos
 
drMerry's Avatar
 
Posts: 293
Karma: 21022
Join Date: Mar 2011
Location: NL
Device: Sony PRS-650
Sure, was confused by the name, but parse_index() does not recuire a default url as parameter.

Thanks
drMerry is offline   Reply With Quote
Advert
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Linking static statically is not just an issue for us. twobob Kindle Developer's Corner 29 08-30-2012 11:03 PM
Content Download a static website to the kindle? scotter Amazon Kindle 1 03-07-2011 06:52 PM
Static screensaver kindle79 Amazon Kindle 2 11-17-2010 02:51 PM
Free Book (Kindle) - The Static of the Spheres koland Deals and Resources (No Self-Promotion or Affiliate Links) 3 06-21-2010 06:24 AM
Static IP grey out rushkk enTourage Archive 1 06-04-2010 11:23 AM


All times are GMT -4. The time now is 08:01 AM.


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