home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2010 November / maximum-cd-2010-11.iso / DiscContents / calibre-0.7.13.msi / file_3673 < prev    next >
Encoding:
Text File  |  2010-02-08  |  769 b   |  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.