From 4325742a353450f19a931c3be290a586a6123cc6 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 31 Dec 2015 10:25:31 +0530 Subject: [PATCH] Update More Intelligent Life Fixes #1529648 [Updated recipe for Intelligent life magazine](https://bugs.launchpad.net/calibre/+bug/1529648) --- recipes/more_intelligent_life.recipe | 39 +++------------------------- 1 file changed, 4 insertions(+), 35 deletions(-) diff --git a/recipes/more_intelligent_life.recipe b/recipes/more_intelligent_life.recipe index e90f883080..1ddc66ba66 100644 --- a/recipes/more_intelligent_life.recipe +++ b/recipes/more_intelligent_life.recipe @@ -1,5 +1,5 @@ __license__ = 'GPL v3' -__copyright__ = '2013, Darko Miletic ' +__copyright__ = '2013 - 2015, Darko Miletic ' ''' moreintelligentlife.com ''' @@ -20,8 +20,9 @@ class MoreIntelligentLife(BasicNewsRecipe): language = 'en' remove_empty_feeds = True publication_type = 'website' + auto_cleanup = True extra_css = """ - body{font-family: Arial,"Helvetica neue","Bitstream Vera Sans",sans-serif} + body{font-family: "DTL Fleischmann-Regular", serif} img{margin-bottom: 0.4em; display:block} """ @@ -32,36 +33,4 @@ class MoreIntelligentLife(BasicNewsRecipe): , 'language' : language } - keep_only_tags = [dict(attrs={'class':'node'})] - remove_tags_after = dict(attrs={'class':'tags'}) - remove_tags = [dict(name=['meta','link','iframe','embed','object'])] - remove_attributes = ['lang'] - - feeds = [(u'Articles', u'http://feeds.feedburner.com/MoreintelligentlifeTotal')] - - def get_cover_url(self): - soup = self.index_to_soup('http://moreintelligentlife.com/') - for image in soup.findAll('img', src=True): - if image['src'].startswith('http://moreintelligentlife.com/files/covers/current_issue_'): - return image['src'] - return None - - def preprocess_html(self, soup): - for item in soup.findAll(style=True): - del item['style'] - for item in soup.findAll('a'): - limg = item.find('img') - if item.string is not None: - str = item.string - item.replaceWith(str) - else: - if limg: - item.name = 'div' - item.attrs = [] - else: - str = self.tag_to_string(item) - item.replaceWith(str) - for item in soup.findAll('img'): - if not item.has_key('alt'): - item['alt'] = 'image' - return soup + feeds = [(u'Articles', u'http://www.intelligentlifemagazine.com/rss/content')]