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

  1. __license__   = 'GPL v3'
  2. __copyright__ = '2009-2010, Darko Miletic <darko.miletic at gmail.com>'
  3. '''
  4. www.variety.com
  5. '''
  6.  
  7. from calibre.web.feeds.recipes import BasicNewsRecipe
  8.  
  9. class Variety(BasicNewsRecipe):
  10.     title                  = 'Variety'
  11.     __author__             = 'Darko Miletic'
  12.     description            = 'Breaking entertainment movie news, movie reviews, entertainment industry events, news and reviews from Cannes, Oscars, and Hollywood awards.  Featuring box office charts, archives and more.'
  13.     oldest_article         = 2
  14.     max_articles_per_feed  = 100
  15.     no_stylesheets         = True
  16.     use_embedded_content   = False
  17.     encoding               = 'cp1252'
  18.     publisher              = 'Red Business Information'
  19.     category               = 'Entertainment Industry News, Daily Variety, Movie Reviews, TV, Awards, Oscars, Cannes, Box Office, Hollywood'
  20.     language               = 'en'
  21.     masthead_url           = 'http://a330.g.akamai.net/7/330/23382/20090528190853/www.variety.com/graphics/variety/Variety_logo_green_tm.gif'
  22.     extra_css              = ' body{font-family: Georgia,"Times New Roman",Times,Courier,serif } img{margin-bottom: 1em} '
  23.  
  24.     conversion_options = {
  25.                              'comments'  : description
  26.                             ,'tags'      : category
  27.                             ,'language'  : language
  28.                             ,'publisher' : publisher
  29.                          }
  30.  
  31.     remove_tags = [dict(name=['object','link','map'])]
  32.  
  33.     keep_only_tags = [dict(name='div', attrs={'id':'article'})]
  34.  
  35.     feeds = [(u'News & Articles', u'http://feeds.feedburner.com/variety/headlines' )]
  36.  
  37.     def print_version(self, url):
  38.         rpt = url.rpartition('?')[0]
  39.         artid = rpt.rpartition('/')[2]
  40.         catidr = url.rpartition('categoryid=')[2]
  41.         catid = catidr.partition('&')[0]
  42.         return 'http://www.variety.com/index.asp?layout=print_story&articleid=' + artid + '&categoryid=' + catid
  43.  
  44.  
  45.     def preprocess_html(self, soup):
  46.         return self.adeify_images(soup)
  47.