home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2010 November / maximum-cd-2010-11.iso / DiscContents / calibre-0.7.13.msi / file_3765 < prev    next >
Encoding:
Text File  |  2010-03-15  |  1.2 KB  |  35 lines

  1. #!/usr/bin/env  python
  2.  
  3. __license__   = 'GPL v3'
  4. __copyright__ = u'2010, Tomasz Dlugosz <tomek3d@gmail.com>'
  5. '''
  6. fronda.pl
  7. '''
  8.  
  9. from calibre.web.feeds.news import BasicNewsRecipe
  10. import re
  11.  
  12. class Fronda(BasicNewsRecipe):
  13.     title          = u'Fronda.pl'
  14.     publisher      = u'Fronda.pl'
  15.     description    = u'Portal po\u015bwi\u0119cony - Infformacje'
  16.     language = 'pl'
  17.     __author__ = u'Tomasz D\u0142ugosz'
  18.     oldest_article = 7
  19.     max_articles_per_feed = 100
  20.     use_embedded_content = False
  21.  
  22.     feeds          = [(u'Infformacje', u'http://fronda.pl/news/feed')]
  23.  
  24.     keep_only_tags = [dict(name='h1', attrs={'class':'big'}),
  25.                       dict(name='ul', attrs={'class':'about clear'}),
  26.                       dict(name='div', attrs={'class':'content'})]
  27.     preprocess_regexps = [
  28.         (re.compile(i[0], re.IGNORECASE | re.DOTALL), i[1]) for i in 
  29.             [ (r'<a href="#" class="print">Drukuj</a>', lambda match: ''),
  30.               (r'<p><a href="http://fronda.pl/sklepy">.*</a></p>', lambda match: ''),
  31.               (r'<p><a href="http://fronda.pl/pasaz">.*</a></p>', lambda match: ''),
  32.               (r'<h3><strong>W.* lektury.*</a></p></div>', lambda match: '</div>'),
  33.               (r'<h3>Zobacz t.*?</div>', lambda match: '</div>') ]
  34.     ]
  35.