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

  1. #!/usr/bin/env  python
  2.  
  3. __license__ = 'GPL v3'
  4. '''
  5. OSNews.pl
  6. '''
  7.  
  8. from calibre.web.feeds.news import BasicNewsRecipe
  9. import re
  10.  
  11. class OSNewsRecipe(BasicNewsRecipe):
  12.     __author__ = u'Mori & Tomasz D\u0142ugosz'
  13.     language = 'pl'
  14.  
  15.     title = u'OSnews.pl'
  16.     publisher = u'OSnews.pl'
  17.     description = u'OSnews.pl jest spo\u0142eczno\u015bciowym serwisem informacyjnym po\u015bwi\u0119conym oprogramowaniu, systemom operacyjnym i \u015bwiatowi IT'
  18.  
  19.     no_stylesheets = True
  20.     remove_javascript = True
  21.     encoding = 'utf-8'
  22.     use_embedded_content = False;
  23.  
  24.     oldest_article = 7
  25.     max_articles_per_feed = 100
  26.  
  27.     extra_css = '''
  28.         .news-heading {font-size:150%}
  29.         .newsinformations li {display:inline;}
  30.         blockquote {border:2px solid #000; padding:5px;}
  31.     '''
  32.  
  33.     feeds = [
  34.         (u'OSNews.pl', u'http://feeds.feedburner.com/OSnewspl')
  35.     ]
  36.  
  37.     keep_only_tags = [
  38.         dict(name = 'a', attrs = {'class' : 'news-heading'}),
  39.         dict(name = 'div', attrs = {'class' : 'newsinformations'}),
  40.         dict(name = 'div', attrs = {'id' : 'news-content'})
  41.     ]
  42.  
  43.     remove_tags = [
  44.         dict(name = 'div', attrs = {'class' : 'sociable'}),
  45.         dict(name = 'div', attrs = {'class' : 'post_prev'}),
  46.         dict(name = 'div', attrs = {'class' : 'post_next'}),
  47.         dict(name = 'div', attrs = {'class' : 'clr'})
  48.     ]
  49.  
  50.     preprocess_regexps = [(re.compile(u'</span>Komentarze: \(?[0-9]+\)? ?<span'), lambda match: '</span><span')]
  51.