#!/usr/bin/env python2 from __future__ import unicode_literals __license__ = 'GPL v3' __copyright__ = '2008, Kovid Goyal ' ''' theatlantic.com ''' import re from calibre.web.feeds.news import BasicNewsRecipe class TheAtlantic(BasicNewsRecipe): title = 'The Atlantic' __author__ = 'Kovid Goyal' description = 'Current affairs and politics focussed on the US' INDEX = 'http://www.theatlantic.com/magazine/toc/0/' language = 'en' encoding = 'utf-8' keep_only_tags = [ {'attrs':{'class':['article-header', 'article-body', 'article-magazine']}}, ] remove_tags = [ {'name': ['meta', 'link', 'noscript']}, {'attrs':{'class':['offset-wrapper', 'ad-boxfeatures-wrapper']}}, {'attrs':{'class':lambda x: x and 'article-tools' in x}}, {'src':lambda x:x and 'spotxchange.com' in x}, ] no_stylesheets = True preprocess_regexps = [ (re.compile(r'', re.DOTALL), lambda m: ''), (re.compile(r'^.*