From 8452127896fb1cebd08182ed7e72fefc8764e457 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 6 Sep 2018 11:51:32 +0530 Subject: [PATCH] Update Howto Geek --- recipes/howtogeek.recipe | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/recipes/howtogeek.recipe b/recipes/howtogeek.recipe index a169995c55..41a955e0bd 100644 --- a/recipes/howtogeek.recipe +++ b/recipes/howtogeek.recipe @@ -13,14 +13,22 @@ class AdvancedUserRecipe1282101454(BasicNewsRecipe): linearize_tables = True no_stylesheets = True remove_javascript = True - masthead_url = 'http://blog.stackoverflow.com/wp-content/uploads/how-to-geek-logo.png' - remove_tags = [dict(name='a', attrs={'target': ['_blank']}), - dict(name='table', attrs={'id': ['articleTable']}), - dict(name='div', attrs={'class': ['feedflare']}), - ] + keep_only_tags = [ + dict(id='main') + ] + remove_tags = [ + dict(name='a', attrs={'target': ['_blank']}), + dict(name='table', attrs={'id': ['articleTable']}), + dict(name='div', attrs={'class': ['feedflare', 'article-share-widgets']}), + ] feeds = [ ('Tips', 'http://feeds.howtogeek.com/howtogeek') ] + + def preprocess_html(self, soup, *a): + for img in soup.findAll('img', attrs={'data-pagespeed-lazy-src': True}): + img['src'] = img['data-pagespeed-lazy-src'] + return soup