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

  1. #!/usr/bin/env  python
  2.  
  3. __license__   = 'GPL v3'
  4. __copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>'
  5. '''
  6. dailyreckoning.com
  7. '''
  8. from calibre.web.feeds.news import BasicNewsRecipe
  9.  
  10. class dailyreckoning_us(BasicNewsRecipe):
  11.     title                 = 'The Daily Reckoning - US edition'
  12.     __author__            = 'Darko Miletic'
  13.     description           = 'Worldwide business and financial news and articles'
  14.     publisher             = 'Agora Financial, LLC.'
  15.     category              = 'news, business, finances, money, banking'
  16.     oldest_article        = 7
  17.     max_articles_per_feed = 100
  18.     no_stylesheets        = True
  19.     use_embedded_content  = False
  20.     encoding              = 'utf-8'
  21.     language              = 'en'
  22.     extra_css             = ' #BlogTitle{font-size: x-large; font-weight: bold} #BlogDate{font-size: small} '
  23.  
  24.     conversion_options = {
  25.                           'comment'   : description
  26.                         , 'tags'      : category
  27.                         , 'publisher' : publisher
  28.                         , 'language'  : language
  29.                         }
  30.  
  31.     feeds = [(u'Articles', u'http://feeds.feedburner.com/dailyreckoning?format=xml')]
  32.  
  33.     keep_only_tags = [dict(name='div', attrs={'id':'Outline'})]
  34.     
  35.     remove_tags = [
  36.                      dict(name=['object','link','base'])
  37.                     ,dict(name='hr', attrs={'class':'Divider'})
  38.                   ]
  39.                   
  40.     remove_tags_after = dict(name='hr', attrs={'class':'Divider'})
  41.  
  42.     def get_article_url(self, article):
  43.         return article.get('feedburner_origlink', article.get('link'))
  44.         
  45.     def print_version(self, url):
  46.         return url + 'print/'
  47.     
  48.