calibre/recipes/politifact.recipe
Kovid Goyal 567040ee1e Perform PEP8 compliance checks on the entire codebase
Some bits of PEP 8 are turned off via setup.cfg
2016-07-29 21:25:17 +05:30

34 lines
1.1 KiB
Plaintext

from calibre.web.feeds.news import BasicNewsRecipe
class PolitiFactCom(BasicNewsRecipe):
title = u'Politifact'
__author__ = u'Michael Heinz'
oldest_article = 21
max_articles_per_feed = 100
language = 'en'
no_stylesheets = True
publication_type = 'magazine'
masthead_url = 'http://static.politifact.com.s3.amazonaws.com/images/politifactdotcom-flag-fff_01.png'
cover_url = 'http://static.politifact.com.s3.amazonaws.com/images/politifactdotcom-flag-fff_01.png'
remove_tags = [
dict(name='div', attrs={'class': 'pfstoryarchive'}),
dict(name='div', attrs={'class': 'pfhead'}),
dict(name='div', attrs={'class': 'boxmid'}),
]
keep_only_tags = [dict(name='div', attrs={'class': 'pfcontentleft'})]
feeds = [
(u'Articles', u'http://www.politifact.com/feeds/articles/truth-o-meter/'),
(u'Obamameter', u'http://politifact.com/feeds/updates/'),
(u'Statements', u'http://www.politifact.com/feeds/statements/truth-o-meter/')
]
def get_browser(self):
br = BasicNewsRecipe.get_browser(self)
br.set_handle_gzip(True)
return br