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 10-09-2011, 08:11 AM   #1
davide125
Member
davide125 began at the beginning.
 
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()
Updated recipe is also attached.

Davide
Attached Files
File Type: zip economist_fullcover.zip (2.2 KB, 240 views)
davide125 is offline   Reply With Quote
Old 10-09-2011, 06:51 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,826
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Thanks, I couldn't find the larger covers on the website after the recent redesign.
kovidgoyal is offline   Reply With Quote
Advert
Old 11-12-2011, 04:38 AM   #3
davide125
Member
davide125 began at the beginning.
 
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
davide125 is offline   Reply With Quote
Old 11-12-2011, 06:26 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: 43,826
Karma: 22666666
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.
kovidgoyal is offline   Reply With Quote
Old 11-12-2011, 09:22 AM   #5
davide125
Member
davide125 began at the beginning.
 
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
davide125 is offline   Reply With Quote
Advert
Old 11-12-2011, 12:33 PM   #6
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,826
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Much better
kovidgoyal is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

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


All times are GMT -4. The time now is 05:48 PM.


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