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