| 1 |
import re |
| 2 |
|
| 3 |
from calibre.web.feeds.news import BasicNewsRecipe |
| 4 |
|
| 5 |
|
| 6 |
class ElMundoTodayRecipe(BasicNewsRecipe): |
| 7 |
title = 'El Mundo Today' |
| 8 |
description = 'La actualidad del ma\u00f1ana' |
| 9 |
category = 'Noticias, humor' |
| 10 |
cover_url = 'http://www.elmundotoday.com/wp-content/themes/EarthlyTouch/images/logo.png' |
| 11 |
oldest_article = 15 |
| 12 |
max_articles_per_feed = 60 |
| 13 |
auto_cleanup = False |
| 14 |
no_stylesheets = True |
| 15 |
remove_javascript = True |
| 16 |
language = 'es' |
| 17 |
use_embedded_content = False |
| 18 |
publication_type = 'blog' |
| 19 |
|
| 20 |
preprocess_regexps = [ |
| 21 |
(re.compile(r'</title>.*<!--Begin Article Single-->', re.DOTALL), lambda match: '</title></head><body>'), |
| 22 |
(re.compile(r'<img alt="" src="http://www.elmundotoday.com/wp-content/themes/emt/images/otrassecciones-line.gif">'), lambda match: ''), |
| 23 |
(re.compile(r'<div style="clear: both;"></div>.*</body>', re.DOTALL), lambda match: '</body>'), |
| 24 |
] |
| 25 |
|
| 26 |
keep_only_tags = [dict(name='div', attrs={'class': 'post-wrapper '})] |
| 27 |
|
| 28 |
remove_tags = [dict(name='div', attrs={'class': 'social4i'}), dict(name='span', attrs={'class': 'num-comentarios'})] |
| 29 |
|
| 30 |
remove_attributes = ['href', 'title', 'alt'] |
| 31 |
|
| 32 |
extra_css = ''' |
| 33 |
.antetitulo{font-variant:small-caps; font-weight:bold} .articleinfo{font-size:small} |
| 34 |
img{margin-bottom:0.4em; display:block; margin-left:auto; margin-right:auto} |
| 35 |
''' |
| 36 |
|
| 37 |
feeds = [('El Mundo Today', 'http://www.elmundotoday.com/feed/')] |