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

  1. # -*- coding: utf-8 -*-
  2. #!/usr/bin/env  python
  3.  
  4. __license__   = 'GPL v3'
  5. __copyright__ = u'2011, Silviu Cotoar\u0103'
  6. '''
  7. babyonline.ro
  8. '''
  9.  
  10. from calibre.web.feeds.news import BasicNewsRecipe
  11.  
  12. class BabyOnline(BasicNewsRecipe):
  13.     title                 = u'Baby Online'
  14.     __author__            = u'Silviu Cotoar\u0103'
  15.     description           = u'De la p\u0103rinte la p\u0103rinte'
  16.     publisher             = u'Baby Online'
  17.     oldest_article        = 50
  18.     language              = 'ro'
  19.     max_articles_per_feed = 100
  20.     no_stylesheets        = True
  21.     use_embedded_content  = False
  22.     category              = 'Ziare,Reviste,Copii,Mame'
  23.     encoding              = 'utf-8'
  24.     cover_url             = 'http://www.babyonline.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':'article_container'})
  35.                      ]
  36.  
  37.     remove_tags = [
  38.                         dict(name='div', attrs={'id':'bar_nav'}),
  39.                         dict(name='div', attrs={'id':'service_send'}),
  40.                         dict(name='div', attrs={'id':'other_videos'}),
  41.                         dict(name='div', attrs={'class':'dot_line_yellow'}),
  42.                         dict(name='a', attrs={'class':'print'}),
  43.                         dict(name='a', attrs={'class':'email'}),
  44.                         dict(name='a', attrs={'class':'YM'}),
  45.                         dict(name='a', attrs={'class':'comment'}),
  46.                         dict(name='div', attrs={'class':'tombstone_cross'}),
  47.                         dict(name='span', attrs={'class':'liketext'})
  48.                   ]
  49.  
  50.     remove_tags_after = [
  51.                         dict(name='div', attrs={'id':'service_send'})
  52.                         ]
  53.  
  54.     feeds          = [
  55.                         (u'Feeds', u'http://www.babyonline.ro/rss_homepage.xml')
  56.                      ]
  57.  
  58.     def preprocess_html(self, soup):
  59.         return self.adeify_images(soup)
  60.