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

  1. # -*- coding: utf-8 -*-
  2.  
  3. __license__   = 'GPL v3'
  4. __copyright__ = '2011, Attis <attis@attis.one.pl>'
  5. __version__ = 'v. 0.1'
  6.  
  7. import re
  8. from calibre.web.feeds.recipes import BasicNewsRecipe
  9.  
  10. class KorespondentPL(BasicNewsRecipe):
  11.     title          = u'Korespondent.pl'
  12.     publisher      = u'Korespondent.pl'
  13.     description    = u'Centrum wolnorynkowe - serwis ludzi wolnych'
  14.     encoding       = 'utf-8'
  15.     __author__     = 'Attis'
  16.     language       = 'pl'
  17.     oldest_article = 15
  18.     max_articles_per_feed = 100
  19.     remove_javascript     = True
  20.     no_stylesheets        = True
  21.  
  22.     keep_only_tags = [dict(name='div', attrs={'class':'publicystyka'})]
  23.     remove_tags    = [{'name': 'meta'}, {'name':'div', 'attrs': {'class': 'zdjecie'} }]
  24.     extra_css      = '.naglowek {font-size: small}\n .tytul {font-size: x-large; padding-bottom: 10px; padding-top: 30px} \n .external {font-size: small}'
  25.  
  26.     preprocess_regexps = [
  27.             (re.compile(u'<a href="index\.php.*>(.*)</a>'),
  28.             lambda match: match.group(1) ),
  29.             (re.compile(u'<i>'),
  30.             lambda match:'<i class="external">' ),
  31.             (re.compile(u'<p></p>Wi─Öcej'),
  32.             lambda match:'Wi─Öcej' ),
  33.             (re.compile(u'target="_blank"'),
  34.             lambda match:'target="_blank" class="external"' ),
  35.             (re.compile(u'<p align="center">\nPoczytaj inne teksty w <a href="http://www.korespondent.pl">Serwisie wolnorynkowym Korespondent.pl</a>.*</body>', re.DOTALL|re.IGNORECASE),
  36.             lambda match: '</div></body>'),
  37.             ]
  38.  
  39.     feeds = [(u'Serwis informacyjny', u'http://korespondent.pl/rss.xml')]
  40.  
  41.