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

  1. import re
  2. from calibre.web.feeds.news import BasicNewsRecipe
  3.  
  4. class AmericanProspect(BasicNewsRecipe):
  5.     title          = u'American Prospect'
  6.     __author__     = u'Michael Heinz'
  7.     oldest_article = 30
  8.     language = 'en'
  9.     max_articles_per_feed = 100
  10.     recursions = 0
  11.     no_stylesheets = True
  12.     remove_javascript = True
  13.  
  14.     preprocess_regexps = [
  15.         (re.compile(r'<body.*?<div class="pad_10L10R">', re.DOTALL|re.IGNORECASE), lambda match: '<body><div>'),
  16.         (re.compile(r'</div>.*</body>', re.DOTALL|re.IGNORECASE), lambda match: '</div></body>'),
  17.         (re.compile('\r'),lambda match: ''),
  18.         (re.compile(r'<!-- .+? -->', re.DOTALL|re.IGNORECASE), lambda match: ''),
  19.         (re.compile(r'<link .+?>', re.DOTALL|re.IGNORECASE), lambda match: ''),
  20.         (re.compile(r'<script.*?</script>', re.DOTALL|re.IGNORECASE), lambda match: ''),
  21.         (re.compile(r'<noscript.*?</noscript>', re.DOTALL|re.IGNORECASE), lambda match: ''),
  22.         (re.compile(r'<meta .*?/>', re.DOTALL|re.IGNORECASE), lambda match: ''),
  23.     ]
  24.  
  25.     feeds       = [(u'Articles', u'feed://www.prospect.org/articles_rss.jsp')]
  26.  
  27.