View Single Post
Old 11-20-2010, 08:58 AM   #1
miwie
Connoisseur
miwie began at the beginning.
 
Posts: 76
Karma: 12
Join Date: Nov 2010
Device: Android, PB Pro 602
spiegelde.recipe: add cover

The following patch to the existing recipe "spiegelde.recipe" adds a cover with the frontpage of the actual edition:
Quote:
mw@miwie:~/epub$ diff -u /usr/share/calibre/recipes/spiegelde.recipe spiegelde.recipe
--- /usr/share/calibre/recipes/spiegelde.recipe 2010-09-13 10:06:00.000000000 +0200
+++ spiegelde.recipe 2010-11-20 14:53:59.000000000 +0100
@@ -5,6 +5,7 @@
spiegel.de
'''

+from time import strftime
from calibre.web.feeds.news import BasicNewsRecipe

class Spiegel_ger(BasicNewsRecipe):
@@ -43,3 +44,6 @@
rmain, rsep, rrest = main.rpartition(',')
purl = rmain + ',druck-' + rrest + ',' + rest
return purl
+
+ def get_cover_url(self):
+ return 'http://wissen.spiegel.de/wissen/titel/SP/' + strftime("%Y/%W/%j/titel.jpg")
Michael
miwie is offline   Reply With Quote