From eb0eb79801f2779ae5effee0764f50804dfd4c50 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 22 Aug 2013 22:10:42 +0530 Subject: [PATCH] Update Consumerist --- recipes/consumerist.recipe | 29 +++++++---------------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/recipes/consumerist.recipe b/recipes/consumerist.recipe index 3d8056e49d..386f640529 100644 --- a/recipes/consumerist.recipe +++ b/recipes/consumerist.recipe @@ -17,14 +17,16 @@ class Consumerist(BasicNewsRecipe): no_stylesheets = True encoding = 'utf-8' use_embedded_content = False + auto_cleanup = True + auto_cleanup_keep = '//div[@class="wp-caption alignleft"]' language = 'en' masthead_url = 'http://consumerist.com/css/images/footer_man.gif' extra_css = ''' - body{font-family: "Lucida Grande",Helvetica,Arial,sans-serif} - img{margin-bottom: 1em} - h1{font-family :Arial,Helvetica,sans-serif; font-size:x-large} - h2{font-family :Arial,Helvetica,sans-serif; font-size:large} - ''' + body{font-family: "Lucida Grande",Helvetica,Arial,sans-serif} + img{margin-bottom: 1em} + h1{font-family :Arial,Helvetica,sans-serif; font-size:x-large} + h2{font-family :Arial,Helvetica,sans-serif; font-size:large} + ''' conversion_options = { 'comment' : description , 'tags' : category @@ -32,22 +34,5 @@ class Consumerist(BasicNewsRecipe): , 'language' : language } - remove_attributes = ['width','height'] - #keep_only_tags = [dict(attrs={'class':['', 'category-breadcrumb']}),] - remove_tags_before = dict(name='h2') - - remove_tags = [ - #dict(name='iframe'), - dict(name='div', attrs={'class':['e-comments', 'more-about', 'entry-tags']}), - #dict(name='div', attrs={'id':['IEContainer', 'clickIncludeBox']}), - #dict(name='ul', attrs={'class':'article-tools'}), - #dict(name='ul', attrs={'class':'articleTools'}), - ] - - remove_tags_after = dict(attrs={'class':'e-body'}) - feeds = [(u'Articles', u'http://consumerist.com/index.xml')] - def preprocess_html(self, soup): - return self.adeify_images(soup) -