| 1 |
# vim:fileencoding=utf-8 |
| 2 |
from __future__ import unicode_literals |
| 3 |
|
| 4 |
__license__ = 'GPL v3' |
| 5 |
__copyright__ = '2012' |
| 6 |
''' |
| 7 |
acrimed.org |
| 8 |
''' |
| 9 |
|
| 10 |
import re |
| 11 |
|
| 12 |
from calibre.web.feeds.news import BasicNewsRecipe |
| 13 |
|
| 14 |
|
| 15 |
class Acrimed(BasicNewsRecipe): |
| 16 |
title = 'Acrimed' |
| 17 |
__author__ = 'Gaƫtan Lehmann' |
| 18 |
oldest_article = 30 |
| 19 |
max_articles_per_feed = 100 |
| 20 |
auto_cleanup = True |
| 21 |
auto_cleanup_keep = '//div[@class="crayon article-chapo-4112 chapo"]' |
| 22 |
language = 'fr' |
| 23 |
masthead_url = 'http://www.acrimed.org/IMG/siteon0.gif' |
| 24 |
feeds = [('Acrimed', 'http://www.acrimed.org/spip.php?page=backend')] |
| 25 |
|
| 26 |
preprocess_regexps = [ |
| 27 |
(re.compile(r'<title>(.*) - Acrimed \| Action Critique M.*dias</title>'), lambda m: '<title>' + m.group(1) + '</title>'), |
| 28 |
(re.compile(r'<h2>(.*) - Acrimed \| Action Critique M.*dias</h2>'), lambda m: '<h2>' + m.group(1) + '</h2>'), |
| 29 |
] |
| 30 |
|
| 31 |
extra_css = ''' |
| 32 |
.chapo{font-style:italic; margin: 1em 0 0.5em} |
| 33 |
''' |