From ccb4f1dbc60ca90a2f7dbc9791e2bd7744f7b7fb Mon Sep 17 00:00:00 2001 From: marc Date: Tue, 15 Apr 2014 15:53:51 +0200 Subject: [PATCH] use gutenweb in list a part recipe --- recipes/list_apart.recipe | 47 +++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/recipes/list_apart.recipe b/recipes/list_apart.recipe index c2a7f48f32..c167c06876 100644 --- a/recipes/list_apart.recipe +++ b/recipes/list_apart.recipe @@ -1,30 +1,29 @@ -# vim:fileencoding=UTF-8 -from __future__ import unicode_literals from calibre.web.feeds.news import BasicNewsRecipe import re +import urllib class AListApart (BasicNewsRecipe): - __author__ = 'Marc Busqué ' - __url__ = 'http://www.lamarciana.com' - __version__ = '2.0.1' - __license__ = 'GPL v3' - __copyright__ = '2012, Marc Busqué ' - title = u'A List Apart' - description = u'A List Apart Magazine (ISSN: 1534-0295) explores the design, development, and meaning of web content, with a special focus on web standards and best practices. This recipe retrieve articles and columns.' - language = 'en' - tags = 'web development, software' - oldest_article = 120 - remove_empty_feeds = True - encoding = 'utf8' - cover_url = u'http://alistapart.com/pix/alalogo.gif' - extra_css = u'img {max-width: 100%; display: block; margin: auto;}' + __author__ = 'Marc Busqué ' + __url__ = 'http://www.lamarciana.com' + __version__ = '2.0.1' + __license__ = 'GPL v3' + __copyright__ = '2012, Marc Busqué ' + title = u'A List Apart' + description = u'A List Apart Magazine (ISSN: 1534-0295) explores the design, development, and meaning of web content, with a special focus on web standards and best practices. This recipe retrieve articles and columns.' + language = 'en' + tags = 'web development, software' + oldest_article = 120 + remove_empty_feeds = True + encoding = 'utf8' + cover_url = u'http://alistapart.com/pix/alalogo.gif' + extra_css = urllib.urlopen('https://raw.githubusercontent.com/laMarciana/gutenweb/master/dist/gutenweb.css').read().replace('@charset "UTF-8";', '') - feeds = [ - (u'A List Apart', u'http://feeds.feedburner.com/alistapart/abridged'), - ] + feeds = [ + (u'A List Apart', u'http://feeds.feedburner.com/alistapart/abridged'), + ] - def image_url_processor(self, baseurl, url): - if re.findall('alistapart\.com', url): - return 'http:'+url - else: - return url + def image_url_processor(self, baseurl, url): + if re.findall('alistapart\.com', url): + return 'http:'+url + else: + return url