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

  1. # -*- coding: utf-8 -*-
  2. #!/usr/bin/env  python
  3.  
  4. __license__   = 'GPL v3'
  5. __copyright__ = u'2011, Silviu Cotoar\u0103'
  6. '''
  7. divahair.ro
  8. '''
  9.  
  10. from calibre.web.feeds.news import BasicNewsRecipe
  11.  
  12. class DivaHair(BasicNewsRecipe):
  13.     title                 = u'Diva Hair'
  14.     language              = 'ro'
  15.     __author__            = u'Silviu Cotoar\u0103'
  16.     description           = u'Coafuri, frizuri, tunsori ..'
  17.     publisher             = u'Diva Hair'
  18.     category              = u'Ziare,Stiri,Coafuri,Femei'
  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.divahair.ro/imgs/logo.jpg'
  26.  
  27.     conversion_options = {
  28.                              'comments'   : description
  29.                             ,'tags'       : category
  30.                             ,'language'   : language
  31.                             ,'publisher'  : publisher
  32.                          }
  33.  
  34.     keep_only_tags = [
  35.                          dict(name='td', attrs={'class':'spatiuart'})
  36.                         , dict(name='div', attrs={'class':'spatiuart'})
  37.                      ]
  38.  
  39.  
  40.     remove_tags = [
  41.                      dict(name='div', attrs={'class':'categorie'})
  42.                      , dict(name='div', attrs={'class':'gri gri2 detaliiart'})
  43.                      , dict(name='div', attrs={'class':'articol_box_bottom'})
  44.                   ]
  45.  
  46.     remove_tags_after = [
  47.                              dict(name='div', attrs={'class':'articol_box_bottom'})
  48.                         ]
  49.  
  50.     feeds = [ (u'\u0218tiri', u'http://www.divahair.ro/feed') ]
  51.  
  52.     def preprocess_html(self, soup):
  53.         return self.adeify_images(soup)
  54.