Debian Codegraph @

recipes/revista_veintitres.recipe

raw
1 # -*- mode: python -*-
2 # -*- coding: utf-8 -*-
3
4 __license__ = 'GPL v3'
5 __copyright__ = '2018, Darko Miletic <darko.miletic at gmail.com>'
6 '''
7 www.veintitres.com.ar
8 '''
9
10 from calibre.web.feeds.news import BasicNewsRecipe
11
12
13 class Veintitres(BasicNewsRecipe):
14 title = 'Revista Veintitres'
15 __author__ = 'Darko Miletic'
16 description = 'Últimas noticias de Política | Revista Veintitrés, información precisa sin perder la mirada crítica'
17 publisher = 'Grupo Crónica'
18 category = 'politica, Argentina'
19 oldest_article = 15
20 max_articles_per_feed = 100
21 no_stylesheets = False
22 use_embedded_content = False
23 encoding = 'utf-8'
24 masthead_url = 'https://www.veintitres.com.ar/export/sites/cronica/arte/veintitres/logos/LogoVeintitres.svg_1890729140.svg'
25 language = 'es_AR'
26 remove_javascript = True
27 publication_type = 'magazine'
28 remove_empty_feeds = True
29 auto_cleanup = True
30 auto_cleanup_keep = '//h1'
31 resolve_internal_links = True
32 INDEX = 'https://www.veintitres.com.ar'
33 extra_css = '''
34 img{margin-bottom: 0.8em}
35 '''
36
37 conversion_options = {'comment': description, 'tags': category, 'publisher': publisher, 'language': language}
38
39 feeds = [
40 ('Politica', 'https://www.veintitres.com.ar/seccion/politica/'),
41 ('Economia y consumo', 'https://www.veintitres.com.ar/seccion/economia-y-consumo/'),
42 ('Cultura', 'https://www.veintitres.com.ar/seccion/cultura/'),
43 ('Internacional', 'https://www.veintitres.com.ar/seccion/internacionales/'),
44 ('Deportes', 'https://www.veintitres.com.ar/seccion/deportes/'),
45 ('Personajes', 'https://www.veintitres.com.ar/seccion/personajes/'),
46 ('Salud', 'https://www.veintitres.com.ar/seccion/salud/'),
47 ('Negocios', 'https://www.veintitres.com.ar/seccion/negocios/'),
48 ('Especial', 'https://www.veintitres.com.ar/seccion/especial/'),
49 ('Opinion', 'https://www.veintitres.com.ar/seccion/opinion/'),
50 ('Tecnologia', 'https://www.veintitres.com.ar/seccion/tecnologia/'),
51 ]
52
53 def parse_index(self):
54 totalfeeds = []
55 lfeeds = self.get_feeds()
56 for feedobj in lfeeds:
57 feedtitle, feedurl = feedobj
58 self.report_progress(0, _('Fetching feed') + ' %s...' % (feedtitle or feedurl))
59 articles = []
60 soup = self.index_to_soup(feedurl)
61 for item in soup.findAll('a', attrs={'class': 'cover-link'}):
62 url = self.INDEX + item['href']
63 title = item['title']
64 articles.append({'title': title, 'date': '', 'url': url, 'description': ''})
65 totalfeeds.append((feedtitle, articles))
66 return totalfeeds