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

  1. # -*- coding: utf-8 -*-
  2. #!/usr/bin/env  python
  3.  
  4. __license__   = 'GPL v3'
  5. __copyright__ = u'2011, Silviu Cotoar\u0103'
  6. '''
  7. gsp.ro
  8. '''
  9.  
  10. from calibre.web.feeds.news import BasicNewsRecipe
  11.  
  12. class GSP(BasicNewsRecipe):
  13.     title                 = u'Gazeta Sporturilor'
  14.     language              = 'ro'
  15.     __author__            = u'Silviu Cotoar\u0103'
  16.     description           = u'Gazeta Sporturilor'
  17.     publisher             = u'Gazeta Sporturilor'
  18.     category              = 'Ziare,Sport,Stiri,Romania'
  19.     oldest_article        = 5
  20.     max_articles_per_feed = 100
  21.     no_stylesheets        = True
  22.     use_embedded_content  = False
  23.     encoding              = 'utf-8'
  24.     remove_javascript     = True
  25.     cover_url             = 'http://www.gsp.ro/images/logo.jpg'
  26.  
  27.     conversion_options = {
  28.                              'comments'   : description
  29.                             ,'tags'       : category
  30.                             ,'language'   : language
  31.                             ,'publisher'  : publisher
  32.                          }
  33.  
  34.     keep_only_tags = [  dict(name='h1', attrs={'class':'serif title_2'})
  35.                        ,dict(name='div', attrs={'id':'only_text'})
  36.                        ,dict(name='span', attrs={'class':'block poza_principala'})
  37.                      ]
  38.                      
  39.     feeds = [ (u'\u0218tiri', u'http://www.gsp.ro/rss.xml') ]
  40.  
  41.     def preprocess_html(self, soup):
  42.         return self.adeify_images(soup)
  43.  
  44.