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

  1. from calibre.web.feeds.news import BasicNewsRecipe
  2. from calibre.ebooks.BeautifulSoup import BeautifulSoup
  3.  
  4. class CourierPress(BasicNewsRecipe):
  5.     title          = u'Courier Press'
  6.     language       = 'en'
  7.     __author__     = 'Krittika Goyal'
  8.     oldest_article = 1 #days
  9.     max_articles_per_feed = 25
  10.  
  11.     remove_stylesheets = True
  12.     remove_tags = [
  13.        dict(name='iframe'),
  14.     ]
  15.  
  16.     feeds          = [
  17. ('Courier Press',
  18.  'http://www.courierpress.com/rss/headlines/news/'),
  19. ]
  20.  
  21.     def preprocess_html(self, soup):
  22.         story = soup.find(name='div', attrs={'id':'article_body'})
  23.         soup = BeautifulSoup('<html><head><title>t</title></head><body></body></html>')
  24.         body = soup.find(name='body')
  25.         body.insert(0, story)
  26.         return soup
  27.