View Single Post
Old 05-17-2011, 03:46 PM   #1
xXxXxXxXxXx
Enthusiast
xXxXxXxXxXx began at the beginning.
 
Posts: 37
Karma: 10
Join Date: Apr 2011
Device: none
Recipe for Glamour (US)

Code:
class AdvancedUserRecipe1305547242(BasicNewsRecipe):
    title          = u'Glamour (US)'
    oldest_article = 21
    max_articles_per_feed = 100
    no_stylesheets         = True
    use_embedded_content   = False
    remove_javascript      = True
    __author__  = 'xXxXxXxXxXx'
    remove_tags = [dict(name='div', attrs={'class':'articles_footer', 'class':'printoptions'})]

    def print_version(self, url):
        return url + '?printable=true'

    def preprocess_html(self, soup):
        for alink in soup.findAll('a'):
            if alink.string is not None:
               tstr = alink.string
               alink.replaceWith(tstr)
        return soup

    feeds  = [	(u'All Fashion', u'http://feeds.glamour.com/glamour/all_fashion'),
                    (u'All Beauty', u'http://feeds.glamour.com/glamour/all_beauty'),
                    (u'All Sex, Love & Life', u'http://feeds.glamour.com/glamour/sex_love_life'),
                    (u'All Health & Fitness', u'http://feeds.glamour.com/glamour/health_fitness'),
                    (u'Shopping', u'http://feeds.glamour.com/glamour/shopping'),
                    (u'Slaves to Fashion blog', u'http://feeds.glamour.com/glamour/slavestofashion'),
                    (u'The Girls in the Beauty Department', u'http://feeds.glamour.com/glamour/thegirlsinthebeautydepartment'),
                    (u'Smitten blog', u'http://feeds.glamour.com/glamour/smitten'),
                    (u'Save the Date', u'http://feeds.feedburner.com/glamour/save-the-date'),
                    (u'Single-ish blog', u'http://feeds.glamour.com/glamour/glamoursingle-ish'),
                    (u'Save the Date', u'http://feeds.feedburner.com/glamour/save-the-date'),
                    (u'Vitamin G blog', u'http://feeds.glamour.com/glamour/vitamin-g'),
                    (u'Margarita Shapes Up blog', u'http://feeds.glamour.com/glamour/margaritashapesup'),
                    (u'Little Miss Fortune blog', u'http://feeds.glamour.com/glamour/little-miss-fortune'),
 ]
xXxXxXxXxXx is offline   Reply With Quote