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

  1. from calibre.web.feeds.news import BasicNewsRecipe
  2.  
  3. class AdvancedUserRecipe1305547242(BasicNewsRecipe):
  4.     title          = u'Glamour (US)'
  5.     oldest_article = 21
  6.     max_articles_per_feed = 100
  7.     no_stylesheets         = True
  8.     use_embedded_content   = False
  9.     language = 'en'
  10.     remove_javascript      = True
  11.     __author__  = 'Anonymous'
  12.     remove_tags = [dict(name='div', attrs={'class':'articles_footer', 'class':'printoptions'})]
  13.  
  14.     def print_version(self, url):
  15.         return url + '?printable=true'
  16.  
  17.     def preprocess_html(self, soup):
  18.         for alink in soup.findAll('a'):
  19.             if alink.string is not None:
  20.                tstr = alink.string
  21.                alink.replaceWith(tstr)
  22.         return soup
  23.  
  24.     feeds  = [    (u'All Fashion', u'http://feeds.glamour.com/glamour/all_fashion'),
  25.                     (u'All Beauty', u'http://feeds.glamour.com/glamour/all_beauty'),
  26.                     (u'All Sex, Love & Life', u'http://feeds.glamour.com/glamour/sex_love_life'),
  27.                     (u'All Health & Fitness', u'http://feeds.glamour.com/glamour/health_fitness'),
  28.                     (u'Shopping', u'http://feeds.glamour.com/glamour/shopping'),
  29.                     (u'Slaves to Fashion blog', u'http://feeds.glamour.com/glamour/slavestofashion'),
  30.                     (u'The Girls in the Beauty Department', u'http://feeds.glamour.com/glamour/thegirlsinthebeautydepartment'),
  31.                     (u'Smitten blog', u'http://feeds.glamour.com/glamour/smitten'),
  32.                     (u'Save the Date', u'http://feeds.feedburner.com/glamour/save-the-date'),
  33.                     (u'Single-ish blog', u'http://feeds.glamour.com/glamour/glamoursingle-ish'),
  34.                     (u'Save the Date', u'http://feeds.feedburner.com/glamour/save-the-date'),
  35.                     (u'Vitamin G blog', u'http://feeds.glamour.com/glamour/vitamin-g'),
  36.                     (u'Margarita Shapes Up blog', u'http://feeds.glamour.com/glamour/margaritashapesup'),
  37.                     (u'Little Miss Fortune blog', u'http://feeds.glamour.com/glamour/little-miss-fortune'),
  38.  ]
  39.