| 1 |
import re |
| 2 |
|
| 3 |
from calibre.web.feeds.news import BasicNewsRecipe |
| 4 |
|
| 5 |
|
| 6 |
class RedVoltaireRecipe(BasicNewsRecipe): |
| 7 |
title = 'Red Voltaire' |
| 8 |
__author__ = 'atordo' |
| 9 |
description = 'Red de prensa no alineada, especializada en el an\u00e1lisis de las relaciones internacionales' |
| 10 |
oldest_article = 7 |
| 11 |
max_articles_per_feed = 30 |
| 12 |
auto_cleanup = False |
| 13 |
no_stylesheets = True |
| 14 |
language = 'es' |
| 15 |
use_embedded_content = False |
| 16 |
remove_javascript = True |
| 17 |
cover_url = 'http://www.voltairenet.org/squelettes/elements/images/logo-voltairenet-org.png' |
| 18 |
masthead_url = 'http://www.voltairenet.org/squelettes/elements/images/logo-voltairenet-org.png' |
| 19 |
|
| 20 |
preprocess_regexps = [ |
| 21 |
( |
| 22 |
re.compile(r'<title>(?P<titulo>.+)</title>.+<span class="updated" title=".+"><time', re.IGNORECASE | re.DOTALL), |
| 23 |
lambda match: '</title></head><body><h1>' + match.group('titulo') + '</h1><time', |
| 24 |
), # noqa: E501 |
| 25 |
( |
| 26 |
re.compile(r'<time datetime=.+pubdate>. (?P<fecha>.+)</time>.+<!------------------- COLONNE TEXTE ------------------->', re.IGNORECASE | re.DOTALL), |
| 27 |
lambda match: '<small>' + match.group('fecha') + '</small>', |
| 28 |
), |
| 29 |
(re.compile(r'<aside>.+', re.IGNORECASE | re.DOTALL), lambda match: '</body></html>'), # noqa: E501 |
| 30 |
] |
| 31 |
|
| 32 |
extra_css = ''' |
| 33 |
img{margin-bottom:0.4em; display:block; margin-left:auto; margin-right:auto} |
| 34 |
''' |
| 35 |
|
| 36 |
feeds = ['http://www.voltairenet.org/spip.php?page=backend&id_secteur=1110&lang=es'] |