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

  1. #!/usr/bin/env  python
  2.  
  3. __license__   = 'GPL v3'
  4. __copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>'
  5. '''
  6. chicagobreakingnews.com
  7. '''
  8.  
  9. from calibre.web.feeds.news import BasicNewsRecipe
  10.  
  11. class ChicagoBreakingNews(BasicNewsRecipe):
  12.     title                 = 'Chicago Breaking News'
  13.     __author__            = 'Darko Miletic'
  14.     description           = 'Breaking News from Chicago'
  15.     oldest_article        = 1
  16.     max_articles_per_feed = 100
  17.     no_stylesheets        = True
  18.     use_embedded_content  = True
  19.     publisher             = 'Chicago Breaking News'
  20.     category              = 'news, politics, USA, Chicago'
  21.     encoding              = 'utf8'
  22.     language = 'en'
  23.  
  24.  
  25.     html2lrf_options = [
  26.                           '--comment', description
  27.                         , '--category', category
  28.                         , '--publisher', publisher
  29.                         ]
  30.  
  31.     html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"'
  32.  
  33.     feeds = [(u'Breaking news', u'http://feeds2.feedburner.com/ChicagoBreakingNews/')]
  34.  
  35.     def preprocess_html(self, soup):
  36.         for item in soup.findAll('a'):
  37.             if item['href'].find('http://feedads.googleadservices.com') > -1:
  38.                item.extract()
  39.         for item in soup.findAll(style=True):
  40.             del item['style']
  41.         for item in soup.findAll(color=True):
  42.             del item['color']
  43.         for item in soup.findAll(size=True):
  44.             del item['size']
  45.         return soup
  46.