From cbd8e8a0708787542d83ded26858ab37d7aea17f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 2 Feb 2014 13:48:51 +0530 Subject: [PATCH] Update wired.it --- recipes/wired_it.recipe | 64 +++++++++++++++++++++++++++++++++++------ 1 file changed, 55 insertions(+), 9 deletions(-) diff --git a/recipes/wired_it.recipe b/recipes/wired_it.recipe index 2c1f8a172d..cd7122b78e 100644 --- a/recipes/wired_it.recipe +++ b/recipes/wired_it.recipe @@ -1,12 +1,58 @@ +import re from calibre.web.feeds.news import BasicNewsRecipe -class AdvancedUserRecipe1325758162(BasicNewsRecipe): - title = u'Wired' +class WiredITA(BasicNewsRecipe): + title = u'Wired.it' + oldest_article = 1 + max_articles_per_feed = 50 + no_stylesheets = True + use_embedded_content = False + auto_cleanup = False + encoding = 'utf8' + masthead_url = 'http://www.wired.com/images/home/wired_logo.gif' + description = 'Wired - Make in Italy. Inventa, sbaglia, innova' + publisher = 'http://www.wired.it/' language = 'it' - oldest_article = 7 - max_articles_per_feed = 100 - auto_cleanup = True - remove_tags_after = [dict(name='div', attrs={'class':'article_content'})] - feeds = [(u'Wired', u'http://www.wired.it/rss.xml')] - __author__ = 'faber1971' - description = 'An American magazine that reports on how new technology affects culture, the economy, and politics' + __author__ = 'isspro' + publication_type = 'magazine' + + conversion_options = {'title' : title, + 'comments' : description, + 'language' : language, + 'publisher' : publisher, + 'authors' : title, + 'smarten_punctuation' : True + } + + keep_only_tags = [ + dict(name='div', attrs={'id':'main-article'}) + ] + + remove_tags = [ + dict(name='img', attrs={'class':'avatar img-circle'}), + dict(name='div', attrs={'class':'topics'}), + dict(name='div', attrs={'class':'social-share hidden-lg'}), + dict(name='span', attrs={'class':'label'}) + ] + + extra_css = ''' + h1 {font-size:x-large;} + p.lead {font-size:medium;} + .who {line-height: 0pt; margin: 0pt;} + ''' + + preprocess_regexps = [ + (re.compile(r'Pubblicato'), lambda match: '') + + ] + + feeds = [(u'Attualit\xe0', u'http://www.wired.it/attualita/feed/'), + (u'Internet','http://www.wired.it/internet/feed/'), + (u'Gadget','http://www.wired.it/gadget/feed/'), + (u'Mobile','http://www.wired.it/mobile/feed/'), + (u'Scienza','http://www.wired.it/scienza/feed/'), + (u'Economia','http://www.wired.it/economia/feed/'), + (u'LifeStyle','http://www.wired.it/lifestyle/feed/'), + (u'Play','http://www.wired.it/play/feed/'), + + ]