From 35d0c080f27420d5f20ff2bd1d6daf1bfe015383 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 3 Dec 2008 16:49:17 -0800 Subject: [PATCH] Recipe for LeMonde (thanks to Mathieu Godlewski) --- src/calibre/gui2/images/news/le_monde.png | Bin 0 -> 767 bytes src/calibre/web/feeds/recipes/le_monde.py | 61 ++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 src/calibre/gui2/images/news/le_monde.png create mode 100644 src/calibre/web/feeds/recipes/le_monde.py diff --git a/src/calibre/gui2/images/news/le_monde.png b/src/calibre/gui2/images/news/le_monde.png new file mode 100644 index 0000000000000000000000000000000000000000..02ba3aba7802d900d03240c58b5767c48ec83aee GIT binary patch literal 767 zcmVPx#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iOb) z5-cT%Yrgsb00MtWL_t(o!|hkGPUAojeQQyWo^?Zs1g!(ox&w)Cpr=3)|Bw$zlaelD zZGIp>5er31vq&_q7AZxVBp(ndO6H2oE_Q4P2ZWq-_aqnIac17UjCY>}0LC71007MU z;gBQ=g3ZM=O_3zYkC7-4czJoj&CLz2udn@Dx7$S=$B5&&lGrxFNs?@Bh#iztEQDYp zVx<&IDS163{!&Wu+1VLeYgsAf*U!(-*;>na^*5zh?k^cX!9uS{{u?rA`KeftN7LvQmN3XykKht$8>c78=o7m;ZvdptUY_=?EBO zcrX~02s#1|S(dqCETt^WK=74Us8*|Cu~=+Iy*+AdX|CY5L`YtJSL76FT?uo)r^9uu_VnDDvlgzuzzT0U<=; zyf?;FIx3|U4~N6wejrH_TwGiL0Eh@$YxMhl5D}!5p6Sui5gLsKo}Qj6yAwj7)9Lv8 z)6-MT=kr1ihlhs;JU>4J&LD0&T4RjwAc`VZN>w@?r$AMXyb8|9=AAJSF{*yFnP9W9 xgSFQC#?Ry+A{Ofz_T^M|=PP002ovPDHLkV1naTSIGbX literal 0 HcmV?d00001 diff --git a/src/calibre/web/feeds/recipes/le_monde.py b/src/calibre/web/feeds/recipes/le_monde.py new file mode 100644 index 0000000000..d3ba64f18d --- /dev/null +++ b/src/calibre/web/feeds/recipes/le_monde.py @@ -0,0 +1,61 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = '2008, Mathieu Godlewski ' +''' +lemonde.fr +''' + +import re + +from calibre.web.feeds.news import BasicNewsRecipe + + +class LeMonde(BasicNewsRecipe): + title = 'LeMonde.fr' + __author__ = 'Mathieu Godlewski ' + description = 'Global news in french' + oldest_article = 7 + max_articles_per_feed = 20 + no_stylesheets = True + + feeds = [ + ('A la Une', 'http://www.lemonde.fr/rss/une.xml'), + ('International', 'http://www.lemonde.fr/rss/sequence/0,2-3210,1-0,0.xml'), + ('Europe', 'http://www.lemonde.fr/rss/sequence/0,2-3214,1-0,0.xml'), + ('Societe', 'http://www.lemonde.fr/rss/sequence/0,2-3224,1-0,0.xml'), + ('Economie', 'http://www.lemonde.fr/rss/sequence/0,2-3234,1-0,0.xml'), + ('Medias', 'http://www.lemonde.fr/rss/sequence/0,2-3236,1-0,0.xml'), + ('Rendez-vous', 'http://www.lemonde.fr/rss/sequence/0,2-3238,1-0,0.xml'), + ('Sports', 'http://www.lemonde.fr/rss/sequence/0,2-3242,1-0,0.xml'), + ('Planete', 'http://www.lemonde.fr/rss/sequence/0,2-3244,1-0,0.xml'), + ('Culture', 'http://www.lemonde.fr/rss/sequence/0,2-3246,1-0,0.xml'), + ('Technologies', 'http://www.lemonde.fr/rss/sequence/0,2-651865,1-0,0.xml'), + ('Cinema', 'http://www.lemonde.fr/rss/sequence/0,2-3476,1-0,0.xml'), + ('Voyages', 'http://www.lemonde.fr/rss/sequence/0,2-3546,1-0,0.xml'), + ('Livres', 'http://www.lemonde.fr/rss/sequence/0,2-3260,1-0,0.xml'), + ('Examens', 'http://www.lemonde.fr/rss/sequence/0,2-3404,1-0,0.xml'), + ('Opinions', 'http://www.lemonde.fr/rss/sequence/0,2-3232,1-0,0.xml') + ] + + remove_tags = [dict(name='img', attrs={'src':'http://medias.lemonde.fr/mmpub/img/lgo/lemondefr_pet.gif'}), + dict(name='div', attrs={'id':'xiti-logo-noscript'}), + dict(name='br', attrs={}), + dict(name='iframe', attrs={}), + ] + + extra_css = '.ar-tit {font-size: x-large;} \n .dt {font-size: x-small;}' + + filter_regexps = [r'xiti\.com'] + + preprocess_regexps = [ (re.compile(i[0], re.IGNORECASE | re.DOTALL), i[1]) for i in + [ + (r'

 

', lambda match : ''), + (r']*>
', lambda match : '
'+match.group(1).upper()), + (r'(
.*
).*', lambda match : match.group(1)), + ] + ] + + def print_version(self, url): + return re.sub('http:.*_([0-9]+)_[0-9]+\.html.*','http://www.lemonde.fr/web/imprimer_element/0,40-0,50-\\1,0.html' ,url) +