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

  1. # -*- coding: utf-8 -*-
  2. #!/usr/bin/env  python
  3.  
  4. __license__   = 'GPL v3'
  5. __copyright__ = u'2011, Silviu Cotoar\u0103'
  6. '''
  7. avantaje.ro
  8. '''
  9.  
  10. from calibre.web.feeds.news import BasicNewsRecipe
  11.  
  12. class Avantaje(BasicNewsRecipe):
  13.     title                 = u'Avantaje'
  14.     __author__            = u'Silviu Cotoar\u0103'
  15.     description           = u''
  16.     publisher             = u'Avantaje'
  17.     oldest_article        = 25
  18.     language              = 'ro'
  19.     max_articles_per_feed = 100
  20.     no_stylesheets        = True
  21.     use_embedded_content  = False
  22.     category              = 'Ziare,Reviste,Stiri'
  23.     encoding              = 'utf-8'
  24.     cover_url             = 'http://www.avantaje.ro/images/default/logo.gif'
  25.  
  26.     conversion_options = {
  27.                              'comments'   : description
  28.                             ,'tags'       : category
  29.                             ,'language'   : language
  30.                             ,'publisher'  : publisher
  31.                          }
  32.  
  33.     keep_only_tags = [
  34.                           dict(name='div', attrs={'id':'articol'})
  35.                         , dict(name='div', attrs={'class':'gallery clearfix'})
  36.                         , dict(name='div', attrs={'align':'justify'})
  37.                      ]
  38.  
  39.     remove_tags = [
  40.                           dict(name='div', attrs={'id':['color_sanatate_box']})
  41.                         , dict(name='div', attrs={'class':['nav']})
  42.                         , dict(name='div', attrs={'class':['voteaza_art']})
  43.                         , dict(name='div', attrs={'class':['bookmark']})
  44.                         , dict(name='div', attrs={'class':['links clearfix']})
  45.                         , dict(name='div', attrs={'class':['title']})
  46.                   ]
  47.  
  48.     remove_tags_after = [
  49.                               dict(name='div', attrs={'class':['title']})
  50.                         ]
  51.  
  52.     feeds          = [
  53.                         (u'Feeds', u'http://feeds.feedburner.com/Avantaje')
  54.                      ]
  55.  
  56.     def preprocess_html(self, soup):
  57.         return self.adeify_images(soup)
  58.