#!/usr/bin/env python2 __license__ = 'GPL v3' __author__ = 'DrMerry Based on v1.01 by Lorenzo Vigentini' __copyright__ = 'For version 1.02, 1.03: DrMerry' __version__ = 'v1.03' __date__ = '11, July 2011' ''' http://www.computeractive.co.uk/ ''' from calibre.web.feeds.news import BasicNewsRecipe import re class computeractive(BasicNewsRecipe): __author__ = 'DrMerry' description = 'Computeractive publishes new downloads, reviews, news stories, step-by-step guides and answers to PC problems every day.' cover_url = 'http://images.pcworld.com/images/common/header/header-logo.gif' title = 'Computer act!ve' publisher = 'Incisive media' category = 'PC, video, computing, product reviews, editing, cameras, production' language = 'en' timefmt = '[%a, %d %b, %Y]' oldest_article = 7 max_articles_per_feed = 25 use_embedded_content = False recursion = 10 remove_javascript = True no_stylesheets = True remove_empty_feeds = True remove_tags_after = dict(name='div', attrs={'class': 'article_tags_block'}) keep_only_tags = [ dict(name='div', attrs={'id': 'container_left'}) ] remove_tags = [ dict(name='div', attrs={'id': ['seeAlsoTags', 'commentsModule', 'relatedArticles', 'mainLeft', 'mainRight', 'recent_comment_block_parent', 'reviewDetails']}), dict(name='div', attrs={'class': ['buyIt', 'detailMpu', 'small_section', 'recent_comment_block_parent', 'title_right_button_fix', 'section_title.title_right_button_fix', 'common_button']}), dict(name='a', attrs={'class': 'largerImage'}) ] preprocess_regexps = [ (re.compile(r'(]*>|)', re.DOTALL | re.IGNORECASE), lambda match: ''), ] feeds = [ (u'General content', u'http://feeds.computeractive.co.uk/rss/latest/computeractive/all'), (u'News', u'http://feeds.computeractive.co.uk/rss/latest/computeractive/news'), ]