home *** CD-ROM | disk | FTP | other *** search
/ Chip 2011 November / CHIP_2011_11.iso / Programy / Narzedzia / Calibre / calibre-0.8.18.msi / file_280 / cbn.recipe < prev    next >
Text File  |  2011-09-09  |  3KB  |  74 lines

  1. from calibre.web.feeds.news import BasicNewsRecipe
  2.  
  3.  
  4. class CBN(BasicNewsRecipe):
  5.     title          = u'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.     language = 'en'
  35.     encoding = 'iso-8859-1'
  36.     conversion_options = {'linearize_tables':True}
  37.  
  38.     # TODO: No masterhead_url for CBN, using one I grepped from a news article
  39.     # (There's a better/higher contrast blue on white background image, but
  40.     # can't get it or it's too big -- embedded into a larger jpeg?)
  41.     masthead_url = 'http://www.cbn.com/templates/images/cbn_com_logo.jpg'
  42.  
  43.     keep_only_tags = [
  44.                         dict(name='h1', attrs={'id':'articleTitle'}),
  45.                         dict(name='div', attrs={'class':'articleAuthor'}),
  46.                         dict(name='div', attrs={'class':'articleDate'}),
  47.                         dict(name='div', attrs={'class':'articleText'}),
  48.                      ]
  49.  
  50.     remove_tags = [
  51.                         # The article image is usually Adobe Flash Player Image
  52.                         # The snapshot .jpg image files of the video are found
  53.                         # within a URL folder named "PageFiles_Files"
  54.                         # Filter this for now.
  55.                         # (Majority of images seem to be Adobe Flash.)
  56.                         dict(name='div', attrs={'class':'articleImage'}),
  57.                   ]
  58.  
  59.  
  60.     # Comment-out or uncomment any of the following RSS feeds according to your
  61.     # liking.
  62.     # A full list can be found here: http://www.cbn.com/rss.aspx
  63.  
  64.     feeds = [
  65.             (u'World', u'http://www.cbn.com/cbnnews/world/feed/'),
  66.             (u'US', u'http://www.cbn.com/cbnnews/us/feed/'),
  67.             (u'Inside Israel', u'http://www.cbn.com/cbnnews/insideisrael/feed/'),
  68.             (u'Politics', u'http://www.cbn.com/cbnnews/politics/feed/'),
  69.             (u'Christian World News', u'http://www.cbn.com/cbnnews/shows/cwn/feed/'),
  70.             (u'Health and Science', u'http://www.cbn.com/cbnnews/healthscience/feed/'),
  71.             (u'Finance', u'http://www.cbn.com/cbnnews/finance/feed/'),
  72.              ]
  73.  
  74.