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

  1. __license__   = 'GPL v3'
  2. __copyright__ = '2009-2010, Darko Miletic <darko.miletic at gmail.com>'
  3.  
  4. '''
  5. www.esquire.com
  6. '''
  7.  
  8. from calibre.web.feeds.news import BasicNewsRecipe
  9.  
  10. class Esquire(BasicNewsRecipe):
  11.     title                 = 'Esquire'
  12.     __author__            = 'Darko Miletic'
  13.     description           = 'Esquire: Man at His Best'
  14.     publisher             = 'Hearst Communications, Inc.'
  15.     category              = 'magazine, men, women we love, style, the guide, sex, screen'
  16.     oldest_article        = 30
  17.     max_articles_per_feed = 100
  18.     no_stylesheets        = True
  19.     encoding              = 'cp1250'
  20.     use_embedded_content  = False
  21.     language              = 'en'
  22.     publication_type      = 'magazine'
  23.     masthead_url          = 'http://www.esquire.com/cm/shared/site_images/print_this/esquire_logo.gif'
  24.  
  25.     conversion_options = {
  26.                           'comment'   : description
  27.                         , 'tags'      : category
  28.                         , 'publisher' : publisher
  29.                         , 'language'  : language
  30.                         }
  31.  
  32.     keep_only_tags    = [dict(name='div', attrs={'id':['article_header','article_content']})]
  33.     remove_tags       = [dict(name=['object','link','embed','iframe','base'])]
  34.     remove_attributes = ['width','height']
  35.  
  36.     feeds = [
  37.                (u'Style'    , u'http://www.esquire.com/style/rss/'    )
  38.               ,(u'Women'    , u'http://www.esquire.com/women/rss/'    )
  39.               ,(u'Features' , u'http://www.esquire.com/features/rss/' )
  40.               ,(u'Fiction'  , u'http://www.esquire.com/fiction/rss/'  )
  41.               ,(u'Frontpage', u'http://www.esquire.com/rss/'          )
  42.             ]
  43.  
  44.     def preprocess_html(self, soup):
  45.         for item in soup.findAll(style=True):
  46.             del item['style']
  47.         return soup
  48.