| 1 |
from calibre.web.feeds.news import BasicNewsRecipe |
| 2 |
|
| 3 |
|
| 4 |
class CBN(BasicNewsRecipe): |
| 5 |
title = 'CBN News' |
| 6 |
__author__ = 'Roger' |
| 7 |
# TODO: I just noticed this is downloading 25+ articles, while |
| 8 |
# the online site is only publishing at most 7 articles daily. |
| 9 |
# So, somehow this needs to be fixed it only downloads max 7 articles |
| 10 |
oldest_article = 7 |
| 11 |
max_articles_per_feed = 100 |
| 12 |
|
| 13 |
description = 'The Christian Broadcasting Network' |
| 14 |
publisher = 'http://www.cbn.com/' |
| 15 |
category = 'news, religion, spiritual, christian' |
| 16 |
language = 'en' |
| 17 |
|
| 18 |
# Make article titles, author and date bold, italic or small font. |
| 19 |
# TODO: Could use a smaller title text |
| 20 |
# TODO: Italicize Author and Publisher? |
| 21 |
# |
| 22 |
# http://www.cbn.com/App_Themes/Common/base.css, |
| 23 |
# http://www.cbn.com/App_Themes/CBNNews/article.css", |
| 24 |
# ... and many more style sheets. |
| 25 |
# extra_css = ''' |
| 26 |
# .story_item_headline { font-size: medium; font-weight: bold; } |
| 27 |
# .story_item_author { font-size: small; font-style:italic; } |
| 28 |
# .signature_line { font-size: small; } |
| 29 |
# ''' |
| 30 |
|
| 31 |
remove_javascript = True |
| 32 |
use_embedded_content = False |
| 33 |
no_stylesheets = True |
| 34 |
encoding = 'iso-8859-1' |
| 35 |
conversion_options = {'linearize_tables': True} |
| 36 |
|
| 37 |
# TODO: No masterhead_url for CBN, using one I grepped from a news article |
| 38 |
# (There's a better/higher contrast blue on white background image, but |
| 39 |
# can't get it or it's too big -- embedded into a larger jpeg?) |
| 40 |
masthead_url = 'http://www.cbn.com/templates/images/cbn_com_logo.jpg' |
| 41 |
|
| 42 |
keep_only_tags = [ |
| 43 |
dict(name='h1', attrs={'id': 'articleTitle'}), |
| 44 |
dict(name='div', attrs={'class': 'articleAuthor'}), |
| 45 |
dict(name='div', attrs={'class': 'articleDate'}), |
| 46 |
dict(name='div', attrs={'class': 'articleText'}), |
| 47 |
] |
| 48 |
|
| 49 |
remove_tags = [ |
| 50 |
# The article image is usually Adobe Flash Player Image |
| 51 |
# The snapshot .jpg image files of the video are found |
| 52 |
# within a URL folder named "PageFiles_Files" |
| 53 |
# Filter this for now. |
| 54 |
# (Majority of images seem to be Adobe Flash.) |
| 55 |
dict(name='div', attrs={'class': 'articleImage'}), |
| 56 |
] |
| 57 |
|
| 58 |
# Comment-out or uncomment any of the following RSS feeds according to your |
| 59 |
# liking. |
| 60 |
# A full list can be found here: http://www.cbn.com/rss.aspx |
| 61 |
|
| 62 |
feeds = [ |
| 63 |
('World', 'http://www.cbn.com/cbnnews/world/feed/'), |
| 64 |
('US', 'http://www.cbn.com/cbnnews/us/feed/'), |
| 65 |
('Inside Israel', 'http://www.cbn.com/cbnnews/insideisrael/feed/'), |
| 66 |
('Politics', 'http://www.cbn.com/cbnnews/politics/feed/'), |
| 67 |
('Christian World News', 'http://www.cbn.com/cbnnews/shows/cwn/feed/'), |
| 68 |
('Health and Science', 'http://www.cbn.com/cbnnews/healthscience/feed/'), |
| 69 |
('Finance', 'http://www.cbn.com/cbnnews/finance/feed/'), |
| 70 |
] |