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

  1.  
  2. __license__   = 'GPL v3'
  3. __copyright__ = '2008-2010, Darko Miletic <darko.miletic at gmail.com>'
  4. '''
  5. lrb.co.uk
  6. '''
  7.  
  8. from calibre.web.feeds.news import BasicNewsRecipe
  9.  
  10. class LondonReviewOfBooks(BasicNewsRecipe):
  11.     title                 = 'London Review of Books (free)'
  12.     __author__            = 'Darko Miletic'
  13.     description           = 'Literary review publishing essay-length book reviews and topical articles on politics, literature, history, philosophy, science and the arts by leading writers and thinkers'
  14.     category              = 'news, literature, UK'
  15.     publisher             = 'LRB ltd.'
  16.     oldest_article        = 15
  17.     max_articles_per_feed = 100
  18.     language              = 'en_GB'
  19.     no_stylesheets        = True
  20.     use_embedded_content  = False
  21.     encoding              = 'utf-8'
  22.     publication_type      = 'magazine'
  23.     masthead_url          = 'http://www.lrb.co.uk/assets/images/lrb_logo_big.gif'
  24.     extra_css             = ' body{font-family: Georgia,Palatino,"Palatino Linotype",serif} '
  25.  
  26.     conversion_options = {
  27.                              'comments'  : description
  28.                             ,'tags'      : category
  29.                             ,'language'  : language
  30.                             ,'publisher' : publisher
  31.                          }
  32.  
  33.     keep_only_tags = [dict(attrs={'class':['article-body indent','letters','article-list']})]
  34.     remove_attributes = ['width','height']
  35.  
  36.     feeds = [(u'London Review of Books', u'http://www.lrb.co.uk/lrbrss.xml')]
  37.  
  38.     def get_cover_url(self):
  39.         cover_url = None
  40.         soup = self.index_to_soup('http://www.lrb.co.uk/')
  41.         cover_item = soup.find('p',attrs={'class':'cover'})
  42.         if cover_item:
  43.            cover_url = 'http://www.lrb.co.uk' + cover_item.a.img['src']
  44.         return cover_url
  45.  
  46.