· 8 years ago · Jan 09, 2018, 12:44 AM
1# -*- mode: python -*-
2# -*- coding: utf-8 -*-
3
4__license__ = 'GPL v3'
5__copyright__ = '2008-2016, Darko Miletic <darko.miletic at gmail.com>'
6
7from calibre.web.feeds.news import BasicNewsRecipe
8
9class Economista(BasicNewsRecipe):
10
11# Datos generales del sitio
12
13 title = 'El Economista'
14 __author__ = 'Unknown'
15 description = 'Diario de noticias y análisis económico'
16 publisher = 'Unknown'
17 category = 'news, politics, economy, finances, Argentina'
18 language = 'es_AR'
19 publication_type = 'newsportal'
20
21# Configuración del scrapper
22
23 oldest_article = 1
24 no_stylesheets = True
25 encoding = 'utf8'
26 use_embedded_content = False
27 remove_empty_feeds = True
28 ignore_duplicate_articles = {'url'}
29 timeout = 120
30
31# Imágenes
32
33 masthead_url = 'http://www.eleconomista.com.ar/wp-content/uploads/2016/04/logonuevo.png'
34 cover_url = 'http://www.eleconomista.com.ar/images/tapa.jpg'
35
36# Fuentes del contenido a descargar
37
38 feeds = [(u'Noticias del dÃa', u'http://www.eleconomista.com.ar/rss')]
39
40# Control de contenido a descargar
41
42 remove_tags_before = dict(attrs={'class': 'entry-title page-header'})
43
44 remove_tags = [dict(attrs={'class': ['yuzo_related_post style-1','post-meta text-left','addtoany_share_save_container addtoany_content_top']}),
45 dict(attrs={'id': ['breadcrumbs']})]
46
47 remove_tags_after = dict(attrs={'class': 'yuzo_related_post style-1'})
48
49# Formato del contenido descargado
50
51 extra_css = """
52 .header p { margin: 1 !important; }
53 .entry-content p { margin: 0 !important; }
54 .entry-content blockquote { margin: 0 !important; }
55 """