From a5a585b204da6bcbb45939155aeeddad05230246 Mon Sep 17 00:00:00 2001 From: lala-rob Date: Fri, 2 Jan 2015 11:18:26 +0100 Subject: [PATCH 1/3] Daily Cover from https://zeitung.sueddeutsche.de/webapp --- recipes/sueddeutsche_mobil.recipe | 5 ++++- recipes/sueddeutschezeitung.recipe | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/recipes/sueddeutsche_mobil.recipe b/recipes/sueddeutsche_mobil.recipe index 6fea1f217d..6976f06501 100644 --- a/recipes/sueddeutsche_mobil.recipe +++ b/recipes/sueddeutsche_mobil.recipe @@ -4,6 +4,7 @@ __copyright__ = '2012, 2013 Andreas Zeiser ' szmobil.sueddeutsche.de/ ''' # History +# 2015.01.02 Daily Cover from https://zeitung.sueddeutsche.de/webapp by lala-rob (web@lala-rob.de) # 2014.12.18 Fixing URL set Cover by lala-rob (web@lala-rob.de) # 2014.10.06 Fixing Login URL and Article URL by lala-rob (web@lala-rob.de) # @@ -12,6 +13,7 @@ szmobil.sueddeutsche.de/ # 2012.08.04 Initial release from calibre import strftime +from time import localtime from calibre.web.feeds.recipes import BasicNewsRecipe import re @@ -24,7 +26,8 @@ class SZmobil(BasicNewsRecipe): language = u'de' publication_type = u'newspaper' category = u'news, politics, Germany' - cover_url = 'http://upload.wikimedia.org/wikipedia/commons/d/d3/Suddeutsche_Zeitung_090520_M.jpg' + lt = localtime() + cover_url = 'https://zeitung.sueddeutsche.de/szdigital/public/issue/previewimage?size=l&issueId=' + strftime("%Y-%m-%d", lt) + '&targetVersion=3&productId=sz no_stylesheets = True oldest_article = 2 encoding = 'iso-8859-1' diff --git a/recipes/sueddeutschezeitung.recipe b/recipes/sueddeutschezeitung.recipe index 184cf85782..893afb3ae5 100644 --- a/recipes/sueddeutschezeitung.recipe +++ b/recipes/sueddeutschezeitung.recipe @@ -4,11 +4,13 @@ __copyright__ = '2010, Darko Miletic ' www.sueddeutsche.de/sz/ ''' # History +# 2015.01.02 Daily Cover from https://zeitung.sueddeutsche.de/webapp by lala-rob (web@lala-rob.de) # 2014.12.15 Set Cover by lala-rob(web@lala-rob.de) # 2014.10.02 Fixed url Problem by lala-rob(web@lala-rob.de) from calibre.web.feeds.news import BasicNewsRecipe from calibre import strftime +from time import localtime class SueddeutcheZeitung(BasicNewsRecipe): title = u'Süddeutsche Zeitung' @@ -22,7 +24,8 @@ class SueddeutcheZeitung(BasicNewsRecipe): needs_subscription = True remove_empty_feeds = True delay = 1 - cover_url = 'http://upload.wikimedia.org/wikipedia/commons/d/d3/Suddeutsche_Zeitung_090520_M.jpg' + lt = localtime() + cover_url = 'https://zeitung.sueddeutsche.de/szdigital/public/issue/previewimage?size=l&issueId=' + strftime("%Y-%m-%d", lt) + '&targetVersion=3&productId=sz PREFIX = 'http://epaper.sueddeutsche.de' INDEX = PREFIX + '/app/epaper/textversion/' use_embedded_content = False From 975080a0f1938e15f58130ceebb3f7bf43c9f992 Mon Sep 17 00:00:00 2001 From: lala-rob Date: Fri, 2 Jan 2015 16:51:47 +0100 Subject: [PATCH 2/3] now use datetime.utcnow() and add one hour for Germany --- recipes/sueddeutsche_mobil.recipe | 5 ++--- recipes/sueddeutschezeitung.recipe | 7 +++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/recipes/sueddeutsche_mobil.recipe b/recipes/sueddeutsche_mobil.recipe index 6976f06501..b997427315 100644 --- a/recipes/sueddeutsche_mobil.recipe +++ b/recipes/sueddeutsche_mobil.recipe @@ -13,7 +13,7 @@ szmobil.sueddeutsche.de/ # 2012.08.04 Initial release from calibre import strftime -from time import localtime +import datetime from calibre.web.feeds.recipes import BasicNewsRecipe import re @@ -26,8 +26,7 @@ class SZmobil(BasicNewsRecipe): language = u'de' publication_type = u'newspaper' category = u'news, politics, Germany' - lt = localtime() - cover_url = 'https://zeitung.sueddeutsche.de/szdigital/public/issue/previewimage?size=l&issueId=' + strftime("%Y-%m-%d", lt) + '&targetVersion=3&productId=sz + cover_url = 'https://zeitung.sueddeutsche.de/szdigital/public/issue/previewimage?size=l&issueId=' + (datetime.datetime.utcnow()+datetime.timedelta(hours=1)).strftime("%Y-%m-%d") + '&targetVersion=3&productId=sz' no_stylesheets = True oldest_article = 2 encoding = 'iso-8859-1' diff --git a/recipes/sueddeutschezeitung.recipe b/recipes/sueddeutschezeitung.recipe index 893afb3ae5..1c5ec5cd02 100644 --- a/recipes/sueddeutschezeitung.recipe +++ b/recipes/sueddeutschezeitung.recipe @@ -9,8 +9,8 @@ www.sueddeutsche.de/sz/ # 2014.10.02 Fixed url Problem by lala-rob(web@lala-rob.de) from calibre.web.feeds.news import BasicNewsRecipe -from calibre import strftime -from time import localtime +from calibre import gmtime +import datetime class SueddeutcheZeitung(BasicNewsRecipe): title = u'Süddeutsche Zeitung' @@ -24,8 +24,7 @@ class SueddeutcheZeitung(BasicNewsRecipe): needs_subscription = True remove_empty_feeds = True delay = 1 - lt = localtime() - cover_url = 'https://zeitung.sueddeutsche.de/szdigital/public/issue/previewimage?size=l&issueId=' + strftime("%Y-%m-%d", lt) + '&targetVersion=3&productId=sz + cover_url = 'https://zeitung.sueddeutsche.de/szdigital/public/issue/previewimage?size=l&issueId=' + (datetime.datetime.utcnow()+datetime.timedelta(hours=1)).strftime("%Y-%m-%d") + '&targetVersion=3&productId=sz' PREFIX = 'http://epaper.sueddeutsche.de' INDEX = PREFIX + '/app/epaper/textversion/' use_embedded_content = False From 7c253cc2d0580b23ca07c04fd3315f1b60fb09b1 Mon Sep 17 00:00:00 2001 From: lala-rob Date: Fri, 2 Jan 2015 16:59:46 +0100 Subject: [PATCH 3/3] Fix import strftime --- recipes/sueddeutschezeitung.recipe | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/sueddeutschezeitung.recipe b/recipes/sueddeutschezeitung.recipe index 1c5ec5cd02..8051a8d879 100644 --- a/recipes/sueddeutschezeitung.recipe +++ b/recipes/sueddeutschezeitung.recipe @@ -9,7 +9,7 @@ www.sueddeutsche.de/sz/ # 2014.10.02 Fixed url Problem by lala-rob(web@lala-rob.de) from calibre.web.feeds.news import BasicNewsRecipe -from calibre import gmtime +from calibre import strftime import datetime class SueddeutcheZeitung(BasicNewsRecipe):