View Single Post
Old 02-02-2014, 10:09 AM   #1
scissors
Addict
scissors ought to be getting tired of karma fortunes by now.scissors ought to be getting tired of karma fortunes by now.scissors ought to be getting tired of karma fortunes by now.scissors ought to be getting tired of karma fortunes by now.scissors ought to be getting tired of karma fortunes by now.scissors ought to be getting tired of karma fortunes by now.scissors ought to be getting tired of karma fortunes by now.scissors ought to be getting tired of karma fortunes by now.scissors ought to be getting tired of karma fortunes by now.scissors ought to be getting tired of karma fortunes by now.scissors ought to be getting tired of karma fortunes by now.
 
Posts: 241
Karma: 1001369
Join Date: Sep 2010
Device: prs300, kindle keyboard 3g
cosmo cleaned up

cosmo recipe cleaned up

Spoiler:
Code:
import re
class AdvancedUserRecipe1390635673(BasicNewsRecipe):
    title          = u'Cosmopolitan UK'
    description = 'Womens Fashion, beauty and Gossip for women from COSMOPOLITAN -UK'

    __author__ = 'Dave Asbury'
   # 2/2/14
    oldest_article = 28
    max_articles_per_feed = 10
    compress_news_images = True
    compress_news_images_max_size = 20
    auto_cleanup_keep = '//div[@class="articleHeading"]'
    auto_cleanup = True
    ignore_duplicate_articles = {'title', 'url'}
    no_stylesheets        = True
    masthead_url = 'http://www.cosmopolitan.co.uk//cm/cosmopolitanuk/site_images/site_logo.gif'
    cover_url ='http://www.natmagnewsletters.co.uk/CIRCULES/CosmoXXLCover.jpg'
    #kovids code
    def preprocess_raw_html(self, raw_html, url):
         for pat, f in [
             (re.compile(r':: [\w].+</title>', re.DOTALL), lambda m: '</title>'),
 
         ]:
             raw_html = pat.sub(f, raw_html)
         return raw_html
    
    feeds          = [
        (u'Love & Sex', u'http://www.cosmopolitan.co.uk/love-sex/rss/'), (u'Men', u'http://cosmopolitan.co.uk/men/rss/'), (u'Fashion', u'http://cosmopolitan.co.uk/fashion/rss/'), (u'Hair & Beauty', u'http://cosmopolitan.co.uk/beauty-hair/rss/'), (u'LifeStyle', u'http://cosmopolitan.co.uk/lifestyle/rss/'), (u'Cosmo On Campus', u'http://cosmopolitan.co.uk/campus/rss/'), (u'Celebrity Gossip', u'http://cosmopolitan.co.uk/celebrity-gossip/rss/')]
scissors is offline   Reply With Quote