From 90ab2881e0868b08814945d22551fe90e2d9513d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 24 Feb 2011 12:29:58 -0700 Subject: [PATCH] Fix Gizmodo and LifeHacker recipes --- resources/recipes/gizmodo.recipe | 14 ++++++-------- resources/recipes/lifehacker.recipe | 20 +++----------------- 2 files changed, 9 insertions(+), 25 deletions(-) diff --git a/resources/recipes/gizmodo.recipe b/resources/recipes/gizmodo.recipe index 4233ef66b7..f6d3fcb782 100644 --- a/resources/recipes/gizmodo.recipe +++ b/resources/recipes/gizmodo.recipe @@ -17,10 +17,9 @@ class Gizmodo(BasicNewsRecipe): max_articles_per_feed = 100 no_stylesheets = True encoding = 'utf-8' - use_embedded_content = False + use_embedded_content = True language = 'en' masthead_url = 'http://cache.gawkerassets.com/assets/gizmodo.com/img/logo.png' - extra_css = ' body{font-family: "Lucida Grande",Helvetica,Arial,sans-serif} img{margin-bottom: 1em} ' conversion_options = { 'comment' : description @@ -29,13 +28,12 @@ class Gizmodo(BasicNewsRecipe): , 'language' : language } - remove_attributes = ['width','height'] - keep_only_tags = [dict(attrs={'class':'content permalink'})] - remove_tags_before = dict(name='h1') - remove_tags = [dict(attrs={'class':'contactinfo'})] - remove_tags_after = dict(attrs={'class':'contactinfo'}) + feeds = [(u'Articles', u'http://feeds.gawker.com/gizmodo/vip?format=xml')] + + remove_tags = [ + {'class': 'feedflare'}, + ] - feeds = [(u'Articles', u'http://feeds.gawker.com/gizmodo/full')] def preprocess_html(self, soup): return self.adeify_images(soup) diff --git a/resources/recipes/lifehacker.recipe b/resources/recipes/lifehacker.recipe index 42e32497be..ff95efc50a 100644 --- a/resources/recipes/lifehacker.recipe +++ b/resources/recipes/lifehacker.recipe @@ -16,15 +16,9 @@ class Lifehacker(BasicNewsRecipe): max_articles_per_feed = 100 no_stylesheets = True encoding = 'utf-8' - use_embedded_content = False + use_embedded_content = True language = 'en' masthead_url = 'http://cache.gawkerassets.com/assets/lifehacker.com/img/logo.png' - extra_css = ''' - body{font-family: "Lucida Grande",Helvetica,Arial,sans-serif} - img{margin-bottom: 1em} - h1{font-family :Arial,Helvetica,sans-serif; font-size:large} - h2{font-family :Arial,Helvetica,sans-serif; font-size:x-small} - ''' conversion_options = { 'comment' : description , 'tags' : category @@ -32,20 +26,12 @@ class Lifehacker(BasicNewsRecipe): , 'language' : language } - remove_attributes = ['width', 'height', 'style'] - remove_tags_before = dict(name='h1') - keep_only_tags = [dict(id='container')] - remove_tags_after = dict(attrs={'class':'post-body'}) remove_tags = [ - dict(id="sharemenu"), - {'class': 'related'}, + {'class': 'feedflare'}, ] - feeds = [(u'Articles', u'http://feeds.gawker.com/lifehacker/full')] + feeds = [(u'Articles', u'http://feeds.gawker.com/lifehacker/vip?format=xml')] def preprocess_html(self, soup): return self.adeify_images(soup) - def print_version(self, url): - return url.replace('#!', '?_escaped_fragment_=') -