home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2011 January / maximum-cd-2011-01.iso / DiscContents / calibre-0.7.26.msi / file_4014 < prev    next >
Encoding:
Text File  |  2010-10-12  |  1.2 KB  |  36 lines

  1. #!/usr/bin/env  python
  2.  
  3. __license__   = 'GPL v3'
  4. __copyright__ = u'2010, Tomasz Dlugosz <tomek3d@gmail.com>'
  5. '''
  6. frazpc.pl
  7. '''
  8.  
  9. from calibre.web.feeds.news import BasicNewsRecipe
  10. import re
  11. class FrazPC(BasicNewsRecipe):
  12.     title          = u'frazpc.pl'
  13.     publisher      = u'frazpc.pl'
  14.     description    = u'Tw\xf3j Vortal Technologiczny'
  15.     language = 'pl'
  16.     __author__ = u'Tomasz D\u0142ugosz'
  17.     oldest_article = 7
  18.     max_articles_per_feed = 100
  19.     use_embedded_content = False
  20.     no_stylesheets = True
  21.  
  22.     feeds          = [(u'Aktualno\u015bci', u'http://www.frazpc.pl/feed'), (u'Recenzje', u'http://www.frazpc.pl/kat/recenzje-2/feed') ]
  23.  
  24.     keep_only_tags = [dict(name='div', attrs={'id':'FRAZ_CONTENT'})]
  25.  
  26.     remove_tags = [dict(name='p', attrs={'class':'gray tagsP fs11'})]
  27.  
  28.     preprocess_regexps = [
  29.         (re.compile(i[0], re.IGNORECASE | re.DOTALL), i[1]) for i in
  30.             [(r'<div id="post-[0-9]*"', lambda match: '<div id="FRAZ_CONTENT"'),
  31.              (r'href="/f/news/', lambda match: 'href="http://www.frazpc.pl/f/news/'),
  32.              (r'   <a href="http://www.frazpc.pl/[^>]*?">(Skomentuj|Komentarz(e)?\([0-9]*\))</a>  \|', lambda match: '')]
  33.     ]
  34.  
  35.     remove_attributes = [ 'width', 'height' ]
  36.