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

  1. from calibre.web.feeds.news import BasicNewsRecipe
  2.  
  3. class AdvancedUserRecipe1305547242(BasicNewsRecipe):
  4.     title          = u'Good House Keeping'
  5.     language = 'en'
  6.     __author__ = 'Anonymous'
  7.     oldest_article = 7
  8.     max_articles_per_feed = 100
  9.     no_stylesheets         = True
  10.     use_embedded_content   = False
  11.     remove_javascript      = True
  12.  
  13.     def print_version(self,url):
  14.           segments = url.split('/')
  15.           printURL = '/'.join(segments[0:3]) + '/print-this/' + '/'.join(segments[4:])
  16.           return printURL
  17.  
  18.     def preprocess_html(self, soup):
  19.         for alink in soup.findAll('a'):
  20.             if alink.string is not None:
  21.                tstr = alink.string
  22.                alink.replaceWith(tstr)
  23.         return soup
  24.  
  25.     feeds  = [    (u'Recipes & Entertaining', u'http://www.goodhousekeeping.com/food/food-rss/?src=rss'),
  26.     (u'Home & House', u'http://www.goodhousekeeping.com/home/home-rss/?src=rss'),
  27.     (u'Diet & Health', u'http://www.goodhousekeeping.com/health/health-rss/?src=rss'),
  28.     (u'Beauty & Style', u'http://www.goodhousekeeping.com/beauty/beauty-rss/?src=rss'),
  29.     (u'Family & Pets', u'http://www.goodhousekeeping.com/family/family-rss/?src=rss'),
  30.     (u'Saving Money', u'http://www.goodhousekeeping.com/money/money-rss/?src=rss'),
  31.     ]
  32.