![]() |
#841 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 820
Karma: 8820388
Join Date: Dec 2008
Device: Sony PRS-505, -350; Kindle 3 3G, DX, PW 2; various tablets
|
Does anybody have some sample code for dealing with incrementing days/months/years in a cover URL?
Here's how the URLs progress for the two recipes I've contributed in this thread: Sports Illustrated covers (weekly) http://i.cdn.turner.com/sivault/si_o...1026_large.jpg http://i.cdn.turner.com/sivault/si_o...1101_large.jpg Smithsonian covers (monthly): http://media.smithsonianmag.com/images/200910_cover.jpg http://media.smithsonianmag.com/images/200911_cover.jpg Somehow, the code needs to figure out the current date, and try the next likely increment. If failure, decrement 7 days (or 1 month for the monthly magazine). Since my two home-grown recipes both have this kind of pattern, I presume that others have encountered and solved this problem already. Or is this the exercise that gets me to learn Python? [EDIT: Ack, the url tags that got automatically inserted for clickability, managed to hide the part of the Sports Illustrated URL which contains year information. Here is what they should look like: h ttp://i.cdn.turner.com/sivault/si_online/covers/images/2009/1026_large.jpg h ttp://i.cdn.turner.com/sivault/si_online/covers/images/2009/1101_large.jpg ] Last edited by jj2me; 10-28-2009 at 10:30 AM. |
![]() |
![]() |
#842 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,397
Karma: 27756918
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
There are two alternative approaches you can take
1) Get the webpage and search for the cover URL in it 2) Try alternative URLs Both require some programming I'll outline 2 Code:
from datetime import datetime, timedelta t = datetime.utcnow() while True: url = t.strftime('http://whatever/%Y/%m%d_large.jpg') try: self.browser.open(url) return url except: t = t - timedelta(days=1) |
![]() |
Advert | |
|
![]() |
#843 |
Member
![]() ![]() Posts: 15
Karma: 150
Join Date: Oct 2009
Device: kindle 2, Kindle Touch, Kindle Paperwhite
|
i'm sorry for asking again but nothing I do fix this. I still only get 5 or 6 sections and I include 8
Any help will be very appreciate Code:
class AdvancedUserRecipe1255971765(BasicNewsRecipe): title = u'Milenio Noticias' oldest_article = 2 max_articles_per_feed = 100 no_stylesheets = True remove_tags_after = dict(name='div',attrs={'class':'go_to'}) remove_tags = [dict(name='div', attrs={'class':'print-logo'})] remove_attributes = ['style', 'width'] remove_attributes = ['style', 'height'] feeds = [(u'Milenio a tiempo', u'http://www.milenio.com/feed/atiempo/df'), (u'Politica', u'http://www.milenio.com/feed/atiempo/politica'), (u'Negocios', u'http://www.milenio.com/feed/atiempo/negocios'), (u'Policia', u'http://www.milenio.com/feed/atiempo/policia'), (u'Tendencias', u'http://www.milenio.com/feed/atiempo/tendencias'), (u'Internacional', u'http://www.milenio.com/feed/atiempo/internacional'), (u'Cultura', u'http://www.milenio.com/feed/atiempo/cultura'), (u'Espectaculos', u'http://www.milenio.com/feed/atiempo/espectaculos')] def print_version(self, url): return url.replace('http://www.milenio.com/node', 'http://www.milenio.com/print') |
![]() |
![]() |
#844 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,397
Karma: 27756918
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
probably because the others contain no articles newer than 2 days
|
![]() |
![]() |
#845 |
Member
![]() Posts: 15
Karma: 10
Join Date: Nov 2008
Device: prs505
|
CNN not downloading articles
Vista SP1 CNN downloads but everything except Sports, Business and one more is just trailers? Uninstalled, nuked everything except the library, reinstalled 6.20, no joy. The job details are attached if that helps
|
![]() |
Advert | |
|
![]() |
#846 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,397
Karma: 27756918
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
probably the website changed and the recipe will have to be adjusted. Opena ticket for it.
|
![]() |
![]() |
#847 |
Member
![]() ![]() Posts: 15
Karma: 150
Join Date: Oct 2009
Device: kindle 2, Kindle Touch, Kindle Paperwhite
|
|
![]() |
![]() |
#848 |
Junior Member
![]() Posts: 1
Karma: 10
Join Date: Oct 2009
Device: Kindle2 International
|
Recipe Request - Freep.com
I would like a recipe to get articles from the Detroit Free Press.
The list of RSS feeds is here. http://freep.com/rss If I can get one that works I can probable get the others myself, like Today's News Headlines, Sports - Spartans, etc... The RSS link is here. http://www.freep.com/apps/pbcs.dll/s...e=rss&mime=xml Which yields this HTML (in part): <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> <channel> <title>freep.com | Local News</title> <description>Latest news County from the Detroit Free Press newspaper of metro Detroit, Michigan, City of Detroit, Oakland County, Wayne County, Macomb County including analysis, commentary and opinion of current events, local news and Detroit area newsmakers.</description> <link>http://www.freep.com</link> <language>en-us</language> <copyright>Copyright 2009, freep.com</copyright> <generator>SaxoTech Online</generator> <pubDate>Sat, 31 Oct 2009 00:00:00 00</pubDate> <lastBuildDate>Sat, 31 Oct 2009 12:53:37 00</lastBuildDate> <ttl>15</ttl> <item> <title>Hundreds at Freedom Hill for H1N1 shots</title> <link>http://www.freep.com/article/20091031/NEWS05/91031007/1001/news</link> <description>Hundreds of adults and children have bundled up in winter garb at Freedom Hill County Park in Sterling Heights, hoping to get vaccinated at the last H1N1 clinic in Macomb County this week.</description> <pubDate>Sat, 31 Oct 2009 11:12:00 00</pubDate> <guid isPermaLink="true">http://www.freep.com/article/20091031/NEWS05/91031007/1001/news</guid> </item> Thanks In advance Det-Mark |
![]() |
![]() |
#849 |
Junior Member
![]() Posts: 1
Karma: 10
Join Date: Nov 2009
Device: Sony PRS 600
|
Hi Guys
Cant seem to download the Irish Independent which has been added to the latest version of calibre as it gets stuck at 47% and hangs.Any ideas? Thanks. |
![]() |
![]() |
#850 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,490
Karma: 5239563
Join Date: Jan 2008
Location: Denmark
Device: Kindle 3|iPad air|iPhone 4S
|
I would like a recipe for
http://jp.dk/rss/udland.jsp (international news) http://jp.dk/rss/indland.jsp (domestic news) http://jp.dk/rss/kultur.jsp (culture news) If it could be combined into one it would be great ![]() |
![]() |
![]() |
#851 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,397
Karma: 27756918
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Sorry guys, I'm down with the flu, so I wont be able to help you for the next few days.
|
![]() |
![]() |
#852 |
The Dank Side of the Moon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 35,907
Karma: 119230421
Join Date: Sep 2009
Location: Denver, CO
Device: Kindle2; Kindle Fire
|
|
![]() |
![]() |
#853 | |
Member
![]() Posts: 14
Karma: 10
Join Date: Nov 2009
Device: Kindle 2 (intl.)
|
Can someone please have a look at the recipe for NZZ Online?
Example output: Quote:
Update: I just created a ticket for this. http://calibre.kovidgoyal.net/ticket/3936 Last edited by --abc--; 11-05-2009 at 10:06 AM. |
|
![]() |
![]() |
#854 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 246
Karma: 4476
Join Date: May 2009
Location: US - Maryland
Device: Sony 300/505/T1 Nook STWG Kobo Glo Kobo Aura HD KDX iPad1 K3 KT PW2
|
Hi,
I read in another thread that a recipe would be a good solution to use to convert books to the .imp format for the EBW1150 in Calibre. If someone could write that recipe it would be great. Thanks. |
![]() |
![]() |
#855 |
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Nov 2009
Device: Sony PRS-600
|
Harper's & The Nation
First, I just want to say thanks to whoever created the Harper's subscription recipe. It works beautifully. But I was wondering, since Harper's gives subscribers access to all past issues, if there was a way to download a specific issue via some input in the Fetch News dialog?
I'd also like to request a recipe for the subscription version of The Nation. Thanks. ** I just figured out that changing the month in Windows will download the Harper's magazine for that particular month... it'd still be nice to select the month within Calibre though. ** Last edited by niaiserie; 11-06-2009 at 07:23 AM. |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Custom column read ? | pchrist7 | Calibre | 2 | 10-04-2010 02:52 AM |
Archive for custom screensavers | sleeplessdave | Amazon Kindle | 1 | 07-07-2010 12:33 PM |
How to back up preferences and custom recipes? | greenapple | Calibre | 3 | 03-29-2010 05:08 AM |
Donations for Custom Recipes | ddavtian | Calibre | 5 | 01-23-2010 04:54 PM |
Help understanding custom recipes | andersent | Calibre | 0 | 12-17-2009 02:37 PM |