From 4e4884c91b0fd2a79e10be569596a6c946b83711 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 10 Dec 2012 07:17:56 +0530 Subject: [PATCH] Update Le Monde --- recipes/le_monde.recipe | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/recipes/le_monde.recipe b/recipes/le_monde.recipe index 8693676da9..318df7e362 100644 --- a/recipes/le_monde.recipe +++ b/recipes/le_monde.recipe @@ -22,13 +22,15 @@ class LeMonde(BasicNewsRecipe): #publication_type = 'newsportal' extra_css = ''' h1{font-size:130%;} + h2{font-size:100%;} + blockquote.aside {background-color: #DDD; padding: 0.5em;} .ariane{font-size:xx-small;} .source{font-size:xx-small;} - #.href{font-size:xx-small;} - #.figcaption style{color:#666666; font-size:x-small;} - #.main-article-info{font-family:Arial,Helvetica,sans-serif;} - #full-contents{font-size:small; font-family:Arial,Helvetica,sans-serif;font-weight:normal;} - #match-stats-summary{font-size:small; font-family:Arial,Helvetica,sans-serif;font-weight:normal;} + /*.href{font-size:xx-small;}*/ + /*.figcaption style{color:#666666; font-size:x-small;}*/ + /*.main-article-info{font-family:Arial,Helvetica,sans-serif;}*/ + /*full-contents{font-size:small; font-family:Arial,Helvetica,sans-serif;font-weight:normal;}*/ + /*match-stats-summary{font-size:small; font-family:Arial,Helvetica,sans-serif;font-weight:normal;}*/ ''' #preprocess_regexps = [(re.compile(r'', re.DOTALL), lambda m: '')] conversion_options = { @@ -44,6 +46,9 @@ class LeMonde(BasicNewsRecipe): filterDuplicates = True def preprocess_html(self, soup): + for aside in soup.findAll('aside'): + aside.name='blockquote' + aside['class'] = "aside" for alink in soup.findAll('a'): if alink.string is not None: tstr = alink.string @@ -107,7 +112,9 @@ class LeMonde(BasicNewsRecipe): ] remove_tags = [ - dict(name='div', attrs={'class':['bloc_base meme_sujet']}), + dict(attrs={'class':['rubriques_liees']}), + dict(attrs={'class':['sociaux']}), + dict(attrs={'class':['bloc_base meme_sujet']}), dict(name='p', attrs={'class':['lire']}) ]