![]() |
#1 |
Member
![]() Posts: 10
Karma: 10
Join Date: Mar 2011
Device: Amazon Kindle 3G
|
better cover for Economist recipe
Hi,
here's a quick patch to get the Economist recipe to download full-size covers, instead of the (mostly unreadable) thumb it's using now: Code:
--- economist.recipe 2011-09-30 10:03:50.000000000 +0200 +++ economist_fullcover.recipe 2011-10-09 14:05:23.550807015 +0200 @@ -22,8 +22,6 @@ ' perspective. Best downloaded on Friday mornings (GMT)') extra_css = '.headline {font-size: x-large;} \n h2 { font-size: small; } \n h1 { font-size: medium; }' oldest_article = 7.0 - cover_url = 'http://media.economist.com/sites/default/files/imagecache/print-cover-thumbnail/print-covers/currentcoverus_large.jpg' - #cover_url = 'http://www.economist.com/images/covers/currentcoverus_large.jpg' remove_tags = [ dict(name=['script', 'noscript', 'title', 'iframe', 'cf_floatingcontent']), dict(attrs={'class':['dblClkTrk', 'ec-article-info', @@ -56,6 +54,14 @@ return br ''' + def get_cover_url(self): + br = BasicNewsRecipe.get_browser() + br.open(self.INDEX) + issue = br.geturl().split('/')[4] + self.log('Fetching issue: %s'%issue) + cover_url = "http://media.economist.com/sites/default/files/imagecache/print-cover-full/print-covers/%s_CNA400.jpg" %(issue.translate(None,'-')) + return cover_url + def parse_index(self): return self.economist_parse_index() Davide |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,194
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Thanks, I couldn't find the larger covers on the website after the recent redesign.
|
![]() |
![]() |
![]() |
#3 |
Member
![]() Posts: 10
Karma: 10
Join Date: Mar 2011
Device: Amazon Kindle 3G
|
Looks like they changed it again: for this week's issue, the cover url is
http://media.economist.com/sites/def...2_CNA400_0.jpg Note the added "_0" at the end of the filename. Davide |
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,194
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Is there someplace on the site that refers to the cover? If so we can parse it and get the correct URL.
|
![]() |
![]() |
![]() |
#5 |
Member
![]() Posts: 10
Karma: 10
Join Date: Mar 2011
Device: Amazon Kindle 3G
|
http://www.economist.com/printedition/covers
the "Enlarge" links point to individual pages like http://www.economist.com/printeditio...eu-la-me-na-uk where you can find the cover image http://media.economist.com/sites/def...2_CNA400_0.jpg for a given issue. Davide Davide |
![]() |
![]() |
![]() |
#6 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,194
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Much better
![]() |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
improved The Economist recipe | baron | Recipes | 37 | 08-04-2011 05:41 PM |
Economist recipe | jdomingos76 | Recipes | 1 | 03-08-2011 08:33 AM |
Problems with economist recipe | lady kay | Calibre | 1 | 08-06-2010 07:49 AM |
Economist (Free) Recipe | geneaber | Calibre | 2 | 01-08-2010 09:21 PM |
Problems with Economist recipe 0.5.1 | MTBSJC | Calibre | 7 | 03-23-2009 01:54 PM |