home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2010 November / maximum-cd-2010-11.iso / DiscContents / calibre-0.7.13.msi / file_4085 < prev    next >
Encoding:
Text File  |  2010-05-15  |  1.6 KB  |  41 lines

  1. __license__   = 'GPL v3'
  2. __copyright__ = '2008 - 2010, Darko Miletic <darko.miletic at gmail.com>'
  3. '''
  4. thenation.com
  5. '''
  6. from calibre.web.feeds.news import BasicNewsRecipe
  7.  
  8. class Thenation(BasicNewsRecipe):
  9.     title                 = 'The Nation'
  10.     __author__            = 'Darko Miletic'
  11.     description           = 'Unconventional Wisdom Since 1865'
  12.     publisher             = 'The Nation'
  13.     category              = 'news, politics, USA'
  14.     oldest_article        = 120
  15.     encoding              = 'utf-8'
  16.     max_articles_per_feed = 100
  17.     no_stylesheets        = True
  18.     language              = 'en'
  19.     use_embedded_content   = False
  20.     delay                  = 1
  21.     masthead_url           = 'http://www.thenation.com/sites/default/themes/thenation/images/logo-main.gif'
  22.     exra_css               = ' body{font-family: Arial,Helvetica,sans-serif;} .print-created{font-size: small;} .caption{display: block; font-size: x-small;} '
  23.  
  24.     conversion_options = {
  25.                           'comment'   : description
  26.                         , 'tags'      : category
  27.                         , 'publisher' : publisher
  28.                         , 'language'  : language
  29.                         }
  30.  
  31.     keep_only_tags = [ dict(attrs={'class':['print-title','print-created','print-content','print-links']}) ]
  32.     remove_tags    = [dict(name='link')]
  33.  
  34.     feeds       = [(u"Editor's Picks", u'http://www.thenation.com/rss/editors_picks')]
  35.  
  36.     def print_version(self, url):
  37.         return url.replace('.thenation.com/','.thenation.com/print/')
  38.  
  39.     def preprocess_html(self, soup):
  40.         return self.adeify_images(soup)
  41.