| 1 |
from calibre.web.feeds.news import BasicNewsRecipe |
| 2 |
|
| 3 |
|
| 4 |
class AdvancedUserRecipe1375900744(BasicNewsRecipe): |
| 5 |
title = 'News24' |
| 6 |
description = 'News24.' |
| 7 |
__author__ = 'Nicki de Wet' |
| 8 |
publisher = 'Media24' |
| 9 |
category = 'news, politics, South Africa' |
| 10 |
oldest_article = 3 |
| 11 |
max_articles_per_feed = 20 |
| 12 |
no_stylesheets = True |
| 13 |
encoding = 'utf8' |
| 14 |
use_embedded_content = False |
| 15 |
auto_cleanup = False |
| 16 |
language = 'en_ZA' |
| 17 |
remove_empty_feeds = True |
| 18 |
publication_type = 'newsportal' |
| 19 |
masthead_url = 'http://www.24.com/images/widgethead_news.png' |
| 20 |
extra_css = ''' |
| 21 |
body{font-family: Arial,Helvetica,sans-serif } |
| 22 |
img{display: block} |
| 23 |
''' |
| 24 |
|
| 25 |
conversion_options = {'comment': description, 'tags': category, 'publisher': publisher, 'language': language} |
| 26 |
|
| 27 |
remove_tags = [ |
| 28 |
dict(name=['object', 'embed', 'iframe', 'table', 'meta', 'link']), |
| 29 |
dict( |
| 30 |
attrs={ |
| 31 |
'class': [ |
| 32 |
'TwitterfacebookLink', |
| 33 |
'superSportArticleBlock', |
| 34 |
'videoHighlights', |
| 35 |
'facebookComments', |
| 36 |
'share', |
| 37 |
'item_block', |
| 38 |
'kalahari_product left', |
| 39 |
'block red', |
| 40 |
'credit', |
| 41 |
] |
| 42 |
} |
| 43 |
), |
| 44 |
dict( |
| 45 |
attrs={ |
| 46 |
'id': [ |
| 47 |
'comments_wrap', |
| 48 |
'article_toolbox_bot', |
| 49 |
'inside_news', |
| 50 |
'sponsored-links', |
| 51 |
'lnkGalleries', |
| 52 |
'relatedlinks_box', |
| 53 |
'lnkUserGalleries', |
| 54 |
'lnkNewsGalleries', |
| 55 |
'relatedlinks', |
| 56 |
'divRelatedLinks', |
| 57 |
] |
| 58 |
} |
| 59 |
), |
| 60 |
] |
| 61 |
|
| 62 |
keep_only_tags = [ |
| 63 |
dict(attrs={'class': ['left col633', 'article col626', 'columnWrapperLeft', 'articlecolumn', 'article_img', 'picture_caption', 'DiveTable']}) |
| 64 |
] |
| 65 |
|
| 66 |
feeds = [ |
| 67 |
('Top Stories', 'http://feeds.news24.com/articles/news24/TopStories/rss'), |
| 68 |
('South Africa', 'http://feeds.news24.com/articles/news24/SouthAfrica/rss'), |
| 69 |
('World', 'http://feeds.news24.com/articles/news24/World/rss'), |
| 70 |
('Sport', 'http://feeds.24.com/articles/sport/featured/topstories/rss'), |
| 71 |
] |