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

  1. #!/usr/bin/env  python
  2.  
  3. __license__ = 'GPL v3'
  4. __author__ = 'Mori'
  5. __version__ = 'v. 0.1'
  6. '''
  7. www.runa.pl/blog
  8. '''
  9.  
  10. from calibre.web.feeds.news import BasicNewsRecipe
  11. import re
  12.  
  13. class FantazmatyRecipe(BasicNewsRecipe):
  14.     __author__ = 'Mori'
  15.     language = 'pl'
  16.  
  17.     title = u'Fantazmaty'
  18.     publisher = u'Agencja Wydawnicza Runa'
  19.     description = u'Blog Agencji Wydawniczej Runa'
  20.     
  21.     no_stylesheets = True
  22.     remove_javascript = True
  23.     encoding = 'utf-8'
  24.     
  25.     oldest_article = 100
  26.     max_articles_per_feed = 100
  27.     
  28.     extra_css = '''
  29.         img{float: left; padding-right: 10px; padding-bottom: 5px;}
  30.     '''
  31.     
  32.     feeds = [
  33.         (u'Fantazmaty', u'http://www.runa.pl/blog/rss.xml')
  34.     ]
  35.     
  36.     remove_tags = [
  37.         dict(name = 'div', attrs = {'class' : 'path'}),
  38.         dict(name = 'div', attrs = {'class' : 'drdot'}),
  39.         dict(name = 'div', attrs = {'class' : 'picture'})
  40.     ]
  41.     
  42.     remove_tags_after = [
  43.         dict(name = 'div', attrs = {'class' : 'content'})
  44.     ]
  45.     
  46.     preprocess_regexps = [
  47.         (re.compile(i[0], re.IGNORECASE | re.DOTALL), i[1]) for i in 
  48.         [
  49.             (r'<body>.*?<div id="primary"', lambda match: '<body><div id="primary"'),
  50.             (r'<!--.*?-->', lambda match: '')
  51.         ]
  52.     ]