Register Guidelines E-Books Today's Posts Search

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

Notices

Closed Thread
 
Thread Tools Search this Thread
Old 10-28-2009, 06:26 AM   #841
jj2me
Guru
jj2me ought to be getting tired of karma fortunes by now.jj2me ought to be getting tired of karma fortunes by now.jj2me ought to be getting tired of karma fortunes by now.jj2me ought to be getting tired of karma fortunes by now.jj2me ought to be getting tired of karma fortunes by now.jj2me ought to be getting tired of karma fortunes by now.jj2me ought to be getting tired of karma fortunes by now.jj2me ought to be getting tired of karma fortunes by now.jj2me ought to be getting tired of karma fortunes by now.jj2me ought to be getting tired of karma fortunes by now.jj2me ought to be getting tired of karma fortunes by now.
 
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.
jj2me is offline  
Old 10-28-2009, 11:37 AM   #842
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: 45,398
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)
kovidgoyal is online now  
Old 10-29-2009, 11:15 PM   #843
elgabo
Member
elgabo doesn't litterelgabo doesn't litter
 
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')
elgabo is offline  
Old 10-30-2009, 11:06 AM   #844
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: 45,398
Karma: 27756918
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
probably because the others contain no articles newer than 2 days
kovidgoyal is online now  
Old 10-30-2009, 09:37 PM   #845
scwehrl
Member
scwehrl began at the beginning.
 
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
Attached Files
File Type: rtf CNNJobDetails.rtf (111.6 KB, 229 views)
scwehrl is offline  
Old 10-30-2009, 09:46 PM   #846
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: 45,398
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.
kovidgoyal is online now  
Old 10-31-2009, 01:01 PM   #847
elgabo
Member
elgabo doesn't litterelgabo doesn't litter
 
Posts: 15
Karma: 150
Join Date: Oct 2009
Device: kindle 2, Kindle Touch, Kindle Paperwhite
Quote:
Originally Posted by kovidgoyal View Post
probably because the others contain no articles newer than 2 days
If I see in calibre internal view there are articles downloaded but when I send to kindle those articles not appear but only the first 5 sections articles.
elgabo is offline  
Old 10-31-2009, 01:51 PM   #848
Det-Mark
Junior Member
Det-Mark began at the beginning.
 
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
Det-Mark is offline  
Old 11-01-2009, 01:53 PM   #849
viv.ie
Junior Member
viv.ie began at the beginning.
 
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.
viv.ie is offline  
Old 11-02-2009, 11:00 AM   #850
Ea
Wizard
Ea ought to be getting tired of karma fortunes by now.Ea ought to be getting tired of karma fortunes by now.Ea ought to be getting tired of karma fortunes by now.Ea ought to be getting tired of karma fortunes by now.Ea ought to be getting tired of karma fortunes by now.Ea ought to be getting tired of karma fortunes by now.Ea ought to be getting tired of karma fortunes by now.Ea ought to be getting tired of karma fortunes by now.Ea ought to be getting tired of karma fortunes by now.Ea ought to be getting tired of karma fortunes by now.Ea ought to be getting tired of karma fortunes by now.
 
Ea's Avatar
 
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
Ea is offline  
Old 11-02-2009, 08:44 PM   #851
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: 45,398
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.
kovidgoyal is online now  
Old 11-02-2009, 10:02 PM   #852
kennyc
The Dank Side of the Moon
kennyc ought to be getting tired of karma fortunes by now.kennyc ought to be getting tired of karma fortunes by now.kennyc ought to be getting tired of karma fortunes by now.kennyc ought to be getting tired of karma fortunes by now.kennyc ought to be getting tired of karma fortunes by now.kennyc ought to be getting tired of karma fortunes by now.kennyc ought to be getting tired of karma fortunes by now.kennyc ought to be getting tired of karma fortunes by now.kennyc ought to be getting tired of karma fortunes by now.kennyc ought to be getting tired of karma fortunes by now.kennyc ought to be getting tired of karma fortunes by now.
 
kennyc's Avatar
 
Posts: 35,907
Karma: 119230421
Join Date: Sep 2009
Location: Denver, CO
Device: Kindle2; Kindle Fire
Quote:
Originally Posted by kovidgoyal View Post
Sorry guys, I'm down with the flu, so I wont be able to help you for the next few days.
Oh No. I hope it's not too bad and not the swine flu!, get better soon, best wishes flowing!
kennyc is offline  
Old 11-05-2009, 10:00 AM   #853
--abc--
Member
--abc-- began at the beginning.
 
--abc--'s Avatar
 
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:
This article was downloaded by calibre from http://www.nzz.ch//nachrichten/wirts...1.3975833.html


| Section menu | Main menu |
| Next | Section menu | Main menu | Previous |
The content is missing.

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.
--abc-- is offline  
Old 11-05-2009, 04:04 PM   #854
bookfanmd
Addict
bookfanmd has a spectacular aura aboutbookfanmd has a spectacular aura aboutbookfanmd has a spectacular aura aboutbookfanmd has a spectacular aura aboutbookfanmd has a spectacular aura aboutbookfanmd has a spectacular aura aboutbookfanmd has a spectacular aura aboutbookfanmd has a spectacular aura aboutbookfanmd has a spectacular aura aboutbookfanmd has a spectacular aura aboutbookfanmd has a spectacular aura about
 
bookfanmd's Avatar
 
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.
bookfanmd is offline  
Old 11-06-2009, 07:09 AM   #855
niaiserie
Junior Member
niaiserie began at the beginning.
 
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.
niaiserie is offline  
Closed Thread


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 12:21 PM.


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