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

  1. __license__   = 'GPL v3'
  2. __copyright__ = '2010, Darko Miletic <darko.miletic at gmail.com>'
  3. '''
  4. nypost.com
  5. '''
  6.  
  7. from calibre.web.feeds.news import BasicNewsRecipe
  8.  
  9. class NYPost(BasicNewsRecipe):
  10.     title                 = 'New York Post'
  11.     __author__            = 'Darko Miletic'
  12.     description           = 'Daily newspaper'
  13.     publisher             = 'NYP Holdings, Inc.'
  14.     category              = 'news, politics, USA'
  15.     oldest_article        = 2
  16.     max_articles_per_feed = 200
  17.     no_stylesheets        = True
  18.     encoding              = 'utf8'
  19.     use_embedded_content  = False
  20.     language              = 'en'
  21.     masthead_url          = 'http://www.nypost.com/rw/SysConfig/WebPortal/nypost/images/nyp_logo_230x32.gif'
  22.     extra_css             = ' body{font-family: Arial,Helvetica,sans-serif } img{margin-bottom: 0.4em} '
  23.  
  24.     conversion_options = {
  25.                           'comment'   : description
  26.                         , 'tags'      : category
  27.                         , 'publisher' : publisher
  28.                         , 'language'  : language
  29.                         }
  30.  
  31.     keep_only_tags=[dict(name='div', attrs={'id':'story'})]
  32.  
  33.     feeds = [(u'Articles', u'http://www.nypost.com/rss/all_section.xml')]
  34.  
  35.     def print_version(self, url):
  36.         return url.replace('nypost.com/p/','nypost.com/f/print/')
  37.