| 1 |
__license__ = 'GPL v3' |
| 2 |
__copyright__ = '2010, Hans Donner <hans.donner at pobox.com>' |
| 3 |
''' |
| 4 |
www.standardmedia.co.ke |
| 5 |
''' |
| 6 |
|
| 7 |
from calibre.web.feeds.news import BasicNewsRecipe |
| 8 |
|
| 9 |
|
| 10 |
class StandardMediaKeRecipe(BasicNewsRecipe): |
| 11 |
__author__ = 'Hans Donner' |
| 12 |
|
| 13 |
title = 'The Standard' |
| 14 |
description = 'News from Kenia' |
| 15 |
language = 'en' |
| 16 |
country = 'KE' |
| 17 |
publication_type = 'newspaper' |
| 18 |
publisher = 'standardmedia.co.ke' |
| 19 |
category = 'news, politics, Kenia' |
| 20 |
|
| 21 |
masthead_url = 'http://www.standardmedia.co.ke/images/easLogoOther.gif' |
| 22 |
|
| 23 |
max_articles_per_feed = 200 |
| 24 |
oldest_article = 3 |
| 25 |
|
| 26 |
use_embedded_content = False |
| 27 |
remove_empty_feeds = True |
| 28 |
|
| 29 |
no_stylesheets = False |
| 30 |
|
| 31 |
feeds = [ |
| 32 |
('Headlines', 'http://www.standardmedia.co.ke/rss/headlines.php'), |
| 33 |
('Business', 'http://www.standardmedia.co.ke/rss/business.php'), |
| 34 |
('Politics', 'http://www.standardmedia.co.ke/rss/politics.php'), |
| 35 |
('Editorial', 'http://www.standardmedia.co.ke/rss/editorial.php'), |
| 36 |
('Columnists', 'http://www.standardmedia.co.ke/rss/columnists.php'), |
| 37 |
('Sports', 'http://www.standardmedia.co.ke/rss/sports.php'), |
| 38 |
('Entertainment', 'http://www.standardmedia.co.ke/rss/entertain.php'), |
| 39 |
] |
| 40 |
|
| 41 |
conversion_options = {'comment': description, 'tags': category, 'publisher': publisher, 'language': language} |
| 42 |
|
| 43 |
def print_version(self, url): |
| 44 |
import re |
| 45 |
|
| 46 |
p = re.compile(r'http://www.standardmedia.co.ke/.*InsidePage.php') |
| 47 |
return p.sub(r'http://www.standardmedia.co.ke/print.php', url) |
| 48 |
|
| 49 |
def preprocess_html(self, soup): |
| 50 |
return self.adeify_images(soup) |