#!/usr/bin/env python __license__ = 'GPL v3' __copyright__ = '2009, Mathieu Godlewski ' ''' Courrier International ''' import re from calibre.web.feeds.news import BasicNewsRecipe class CourrierInternational(BasicNewsRecipe): title = 'Courrier International' __author__ = 'Mathieu Godlewski ' description = 'Global news in french from international newspapers' oldest_article = 7 language = 'fr' max_articles_per_feed = 50 no_stylesheets = True html2lrf_options = ['--base-font-size', '10'] feeds = [ # Some articles requiring subscription fails on download. ('A la Une', 'http://www.courrierinternational.com/rss/rss_a_la_une.xml'), ] preprocess_regexps = [ (re.compile(i[0], re.IGNORECASE|re.DOTALL), i[1]) for i in [ #Handle Depeches (r'.*]*>([0-9][0-9]/.*

).*', lambda match : '
'+match.group(1)+'
'), #Handle Articles (r'.*]*>(Courrier international.*?) .*', lambda match : '
'+match.group(1)+''), ] ] def print_version(self, url): return re.sub('/[a-zA-Z]+\.asp','/imprimer.asp' ,url)