home *** CD-ROM | disk | FTP | other *** search
/ Chip 2011 November / CHIP_2011_11.iso / Programy / Narzedzia / Calibre / calibre-0.8.18.msi / file_280 / kamikaze.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. kamikazeonline.ro
  8. '''
  9.  
  10. from calibre.web.feeds.news import BasicNewsRecipe
  11.  
  12. class Kamikaze(BasicNewsRecipe):
  13.     title                 = u'Kamikaze'
  14.     __author__            = u'Silviu Cotoar\u0103'
  15.     description           = u'S\u0103pt\u0103m\u00e2nal sc\u0103pat de sub control'
  16.     publisher             = 'Kamikaze'
  17.     oldest_article        = 5
  18.     language              = 'ro'
  19.     max_articles_per_feed = 100
  20.     no_stylesheets        = True
  21.     use_embedded_content  = False
  22.     category              = 'Ziare,Reviste'
  23.     encoding              = 'utf-8'
  24.     cover_url             = 'http://www.kamikazeonline.ro/wp-content/themes/kamikaze/images/kamikazeonline_header.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':'content'})
  35.                      ]
  36.  
  37.     remove_tags = [
  38.              dict(name='div', attrs={'class':['connect_confirmation_cell connect_confirmation_cell_no_like']})
  39.            , dict(name='h3', attrs={'id':['comments']})
  40.            , dict(name='ul', attrs={'class':['addtoany_list']})
  41.            , dict(name='p', attrs={'class':['postmetadata']})
  42.                   ]
  43.  
  44.     remove_tags_after = [
  45.              dict(name='p', attrs={'class':['postmetadata']})
  46.             ]
  47.  
  48.     feeds          = [
  49.             (u'Feeds', u'http://www.kamikazeonline.ro/feed/')
  50.                  ]
  51.  
  52.     def preprocess_html(self, soup):
  53.         return self.adeify_images(soup)
  54.