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

  1. __license__   = 'GPL v3'
  2. __copyright__ = '2010, NA'
  3. '''
  4. jalopnik.com
  5. '''
  6.  
  7. from calibre.web.feeds.news import BasicNewsRecipe
  8.  
  9. class Jalopnik(BasicNewsRecipe):
  10.     title                 = 'Jalopnik'
  11.     __author__            = 'NA'
  12.     description           = "Jalopnik, Obsessed With The Cult of Cars."
  13.     publisher             = 'jalopnik.com'
  14.     category              = 'news, cars, spyshots'
  15.     oldest_article        = 2
  16.     max_articles_per_feed = 100
  17.     no_stylesheets        = True
  18.     encoding              = 'utf-8'
  19.     use_embedded_content  = False
  20.     language              = 'en'
  21.     masthead_url          = 'http://cache.gawkerassets.com/assets/jalopnik.com/img/logo.png'
  22.     extra_css             = '''
  23.     body{font-family: "Lucida Grande",Helvetica,Arial,sans-serif}
  24.     img{margin-bottom: 1em}
  25.     h1{font-family :Arial,Helvetica,sans-serif; font-size:large}
  26.     h2{font-family :Arial,Helvetica,sans-serif; font-size:x-small}
  27.                   '''
  28.     conversion_options = {
  29.                           'comment'   : description
  30.                         , 'tags'      : category
  31.                         , 'publisher' : publisher
  32.                         , 'language'  : language
  33.                         }
  34.  
  35.     remove_attributes  = ['width','height']
  36.     keep_only_tags     = [dict(attrs={'class':'content permalink'})]
  37.     remove_tags_before = dict(name='h1')
  38.     remove_tags        = [dict(attrs={'class':'contactinfo'})]
  39.     remove_tags_after  = dict(attrs={'class':'contactinfo'})
  40.  
  41.     feeds = [(u'Articles', u'http://feeds.gawker.com/jalopnik/full')]
  42.  
  43.     def preprocess_html(self, soup):
  44.         return self.adeify_images(soup)
  45.  
  46.