From b3a07dec8b960459623679e8ddab4a6f2ab546f0 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 27 Jan 2012 09:46:22 +0530 Subject: [PATCH] Update Sueddeutsche.de --- recipes/sueddeutsche.recipe | 43 +++++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/recipes/sueddeutsche.recipe b/recipes/sueddeutsche.recipe index 4b5fb4e7bf..4e683ef0a9 100644 --- a/recipes/sueddeutsche.recipe +++ b/recipes/sueddeutsche.recipe @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- __license__ = 'GPL v3' -__copyright__ = '2008, Kovid Goyal ' +__copyright__ = '2012, Kovid Goyal ' # 2012-01-26 AGe change to actual Year ''' Fetch sueddeutsche.de @@ -8,19 +8,30 @@ Fetch sueddeutsche.de from calibre.web.feeds.news import BasicNewsRecipe class Sueddeutsche(BasicNewsRecipe): - title = u'sueddeutsche.de' - description = 'News from Germany' - __author__ = 'Oliver Niesner and Armin Geller' #Update AGe 2011-12-16 - use_embedded_content = False - timefmt = ' [%d %b %Y]' - oldest_article = 7 - max_articles_per_feed = 50 - no_stylesheets = True - language = 'de' - encoding = 'utf-8' - remove_javascript = True - auto_cleanup = True - cover_url = 'http://polpix.sueddeutsche.com/polopoly_fs/1.1237395.1324054345!/image/image.jpg_gen/derivatives/860x860/image.jpg' # 2011-12-16 AGe + title = u'Süddeutsche.de' # 2012-01-26 AGe Correct Title + description = 'News from Germany, Access to online content' # 2012-01-26 AGe + __author__ = 'Oliver Niesner and Armin Geller' #Update AGe 2012-01-26 + publisher = 'Süddeutsche Zeitung' # 2012-01-26 AGe add + category = 'news, politics, Germany' # 2012-01-26 AGe add + timefmt = ' [%a, %d %b %Y]' # 2012-01-26 AGe add %a + oldest_article = 7 + max_articles_per_feed = 100 + language = 'de' + encoding = 'utf-8' + publication_type = 'newspaper' # 2012-01-26 add + cover_source = 'http://www.sueddeutsche.de/verlag' # 2012-01-26 AGe add from Darko Miletic paid content source + masthead_url = 'http://www.sueddeutsche.de/static_assets/build/img/sdesiteheader/logo_homepage.441d531c.png' # 2012-01-26 AGe add + + use_embedded_content = False + no_stylesheets = True + remove_javascript = True + auto_cleanup = True + + def get_cover_url(self): # 2012-01-26 AGe add from Darko Miletic paid content source + cover_source_soup = self.index_to_soup(self.cover_source) + preview_image_div = cover_source_soup.find(attrs={'class':'preview-image'}) + return preview_image_div.div.img['src'] + feeds = [ (u'Politik', u'http://suche.sueddeutsche.de/query/%23/sort/-docdatetime/drilldown/%C2%A7ressort%3A%5EPolitik%24?output=rss'), (u'Wirtschaft', u'http://suche.sueddeutsche.de/query/%23/sort/-docdatetime/drilldown/%C2%A7ressort%3A%5EWirtschaft%24?output=rss'), @@ -29,6 +40,9 @@ class Sueddeutsche(BasicNewsRecipe): (u'Sport', u'http://suche.sueddeutsche.de/query/%23/sort/-docdatetime/drilldown/%C2%A7ressort%3A%5ESport%24?output=rss'), (u'Leben', u'http://suche.sueddeutsche.de/query/%23/sort/-docdatetime/drilldown/%C2%A7ressort%3A%5ELeben%24?output=rss'), (u'Karriere', u'http://suche.sueddeutsche.de/query/%23/sort/-docdatetime/drilldown/%C2%A7ressort%3A%5EKarriere%24?output=rss'), + (u'Bildung', u'http://rss.sueddeutsche.de/rss/bildung'), #2012-01-26 AGe New + (u'Gesundheit', u'http://rss.sueddeutsche.de/rss/gesundheit'), #2012-01-26 AGe New + (u'Stil', u'http://rss.sueddeutsche.de/rss/stil'), #2012-01-26 AGe New (u'München & Region', u'http://suche.sueddeutsche.de/query/%23/sort/-docdatetime/drilldown/%C2%A7ressort%3A%5EMünchen&Region%24?output=rss'), (u'Bayern', u'http://suche.sueddeutsche.de/query/%23/sort/-docdatetime/drilldown/%C2%A7ressort%3A%5EBayern%24?output=rss'), (u'Medien', u'http://suche.sueddeutsche.de/query/%23/sort/-docdatetime/drilldown/%C2%A7ressort%3A%5EMedien%24?output=rss'), @@ -42,6 +56,7 @@ class Sueddeutsche(BasicNewsRecipe): (u'Job', u'http://suche.sueddeutsche.de/query/%23/sort/-docdatetime/drilldown/%C2%A7ressort%3A%5EJob%24?output=rss'), # sometimes only (u'Service', u'http://suche.sueddeutsche.de/query/%23/sort/-docdatetime/drilldown/%C2%A7ressort%3A%5EService%24?output=rss'), # sometimes only (u'Verlag', u'http://suche.sueddeutsche.de/query/%23/sort/-docdatetime/drilldown/%C2%A7ressort%3A%5EVerlag%24?output=rss'), # sometimes only + ] # AGe 2011-12-16 Problem of Handling redirections solved by a solution of Recipes-Re-usable code from kiklop74. # Feed is: http://suche.sueddeutsche.de/query/%23/sort/-docdatetime/drilldown/%C2%A7ressort%3A%5ESport%24?output=rss