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

  1.  
  2. __license__   = 'GPL v3'
  3. __copyright__ = '2010, Darko Miletic <darko.miletic at gmail.com>'
  4. '''
  5. gizmodo.com
  6. '''
  7.  
  8. from calibre.web.feeds.news import BasicNewsRecipe
  9.  
  10. class Gizmodo(BasicNewsRecipe):
  11.     title                 = 'Gizmodo'
  12.     __author__            = 'Darko Miletic'
  13.     description           = "Gizmodo, the gadget guide. So much in love with shiny new toys, it's unnatural."
  14.     publisher             = 'gizmodo.com'
  15.     category              = 'news, IT, Internet, gadgets'
  16.     oldest_article        = 2
  17.     max_articles_per_feed = 100
  18.     no_stylesheets        = True
  19.     encoding              = 'utf-8'
  20.     use_embedded_content  = False
  21.     language              = 'en'
  22.     masthead_url          = 'http://cache.gawkerassets.com/assets/gizmodo.com/img/logo.png'
  23.     extra_css             = ' body{font-family: "Lucida Grande",Helvetica,Arial,sans-serif} img{margin-bottom: 1em} '
  24.  
  25.     conversion_options = {
  26.                           'comment'   : description
  27.                         , 'tags'      : category
  28.                         , 'publisher' : publisher
  29.                         , 'language'  : language
  30.                         }
  31.  
  32.     remove_attributes  = ['width','height']
  33.     keep_only_tags     = [dict(attrs={'class':'content permalink'})]
  34.     remove_tags_before = dict(name='h1')
  35.     remove_tags        = [dict(attrs={'class':'contactinfo'})]
  36.     remove_tags_after  = dict(attrs={'class':'contactinfo'})
  37.  
  38.     feeds = [(u'Articles', u'http://feeds.gawker.com/gizmodo/full')]
  39.  
  40.     def preprocess_html(self, soup):
  41.         return self.adeify_images(soup)
  42.  
  43.