calibre/recipes/standardmedia_ke.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

51 lines
1.6 KiB
Plaintext

__license__ = 'GPL v3'
__copyright__ = '2010, Hans Donner <hans.donner at pobox.com>'
'''
www.standardmedia.co.ke
'''
from calibre.web.feeds.news import BasicNewsRecipe
class StandardMediaKeRecipe(BasicNewsRecipe):
__author__ = 'Hans Donner'
title = u'The Standard'
description = 'News from Kenia'
language = 'en'
country = 'KE'
publication_type = 'newspaper'
publisher = 'standardmedia.co.ke'
category = 'news, politics, Kenia'
masthead_url = 'http://www.standardmedia.co.ke/images/easLogoOther.gif'
max_articles_per_feed = 200
oldest_article = 3
use_embedded_content = False
remove_empty_feeds = True
no_stylesheets = False
feeds = [(u'Headlines', u'http://www.standardmedia.co.ke/rss/headlines.php'),
(u'Business', u'http://www.standardmedia.co.ke/rss/business.php'),
(u'Politics', u'http://www.standardmedia.co.ke/rss/politics.php'),
(u'Editorial', u'http://www.standardmedia.co.ke/rss/editorial.php'),
(u'Columnists', u'http://www.standardmedia.co.ke/rss/columnists.php'),
(u'Sports', u'http://www.standardmedia.co.ke/rss/sports.php'),
(u'Entertainment', u'http://www.standardmedia.co.ke/rss/entertain.php')]
conversion_options = {
'comment': description, 'tags': category, 'publisher': publisher, 'language': language
}
def print_version(self, url):
import re
p = re.compile('http://www.standardmedia.co.ke/.*InsidePage.php')
return p.sub('http://www.standardmedia.co.ke/print.php', url)
def preprocess_html(self, soup):
return self.adeify_images(soup)