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

  1. __license__   = 'GPL v3'
  2. __copyright__ = '2010, Darko Miletic <darko.miletic at gmail.com>'
  3. '''
  4. gamasutra.com
  5. '''
  6.  
  7. from calibre.web.feeds.news import BasicNewsRecipe
  8.  
  9. class Gamasutra(BasicNewsRecipe):
  10.     title                 = 'Gamasutra News'
  11.     __author__            = 'Darko Miletic'
  12.     description           = 'The Art and Business of Making Games'
  13.     publisher             = 'Gamasutra'
  14.     category              = 'news, games, IT'
  15.     oldest_article        = 2
  16.     max_articles_per_feed = 200
  17.     no_stylesheets        = True
  18.     encoding              = 'cp1252'
  19.     use_embedded_content  = False
  20.     language              = 'en'
  21.     remove_empty_feeds    = True
  22.     masthead_url          = 'http://www.gamasutra.com/images/gamasutra_logo.gif'
  23.     extra_css             = ' body{font-family: Verdana,Arial,Helvetica,sans-serif } img{margin-bottom: 0.4em} .newsTitle{font-size: xx-large; font-weight: bold} '
  24.  
  25.     conversion_options = {
  26.                           'comment'          : description
  27.                         , 'tags'             : category
  28.                         , 'publisher'        : publisher
  29.                         , 'language'         : language
  30.                         , 'linearize_tables' : True
  31.                         }
  32.  
  33.     remove_tags       = [dict(attrs={'class':['relatedNews','adBox']})]
  34.     keep_only_tags    = [dict(attrs={'class':['newsTitle','newsAuth','newsDate','newsText']})]
  35.     remove_attributes = ['width','height']
  36.  
  37.     feeds = [(u'News', u'http://feeds.feedburner.com/GamasutraNews')]
  38.  
  39.     def get_article_url(self, article):
  40.         return article.get('guid',  None)
  41.  
  42.     def preprocess_html(self, soup):
  43.         for item in soup.findAll(style=True):
  44.             del item['style']
  45.         return self.adeify_images(soup)
  46.