From fe4bceea0055191a29e4700dd129a5ef1effabaa Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 10 Jan 2018 23:46:09 +0530 Subject: [PATCH] Cronica by Darko Miletic Fixes #1742486 [New recipe for Cronica](https://bugs.launchpad.net/calibre/+bug/1742486) --- recipes/cronica.recipe | 79 ++++++++++++++++++++++++++++++++++++++ recipes/icons/cronica.png | Bin 0 -> 682 bytes 2 files changed, 79 insertions(+) create mode 100644 recipes/cronica.recipe create mode 100644 recipes/icons/cronica.png diff --git a/recipes/cronica.recipe b/recipes/cronica.recipe new file mode 100644 index 0000000000..7a7ba02b99 --- /dev/null +++ b/recipes/cronica.recipe @@ -0,0 +1,79 @@ +# -*- mode: python -*- +# -*- coding: utf-8 -*- + +__license__ = 'GPL v3' +__copyright__ = '2018, Darko Miletic ' +''' +www.cronica.com.ar +''' + +from calibre.web.feeds.news import BasicNewsRecipe + + +class Veintitres(BasicNewsRecipe): + title = 'Cronica' + __author__ = 'Darko Miletic' + description = 'Últimas noticias' + publisher = 'Grupo Crónica' + category = 'politica, noticias generales, Argentina' + oldest_article = 15 + max_articles_per_feed = 100 + no_stylesheets = False + use_embedded_content = False + encoding = 'utf-8' + masthead_url = 'https://www.cronica.com.ar/export/sites/cronica/arte/logos/logoCronica.svg_799932565.svg' + language = 'es_AR' + remove_javascript = True + publication_type = 'magazine' + remove_empty_feeds = True + auto_cleanup = True + auto_cleanup_keep = '//h1' + resolve_internal_links = True + INDEX = "https://www.cronica.com.ar" + extra_css = """ + img{margin-bottom: 0.8em} + """ + + conversion_options = { + 'comment': description, + 'tags': category, + 'publisher': publisher, + 'language': language + } + + feeds = [ + (u'Policiales', u'https://www.cronica.com.ar/seccion/policiales/'), + (u'Politica', u'https://www.cronica.com.ar/seccion/politica/'), + (u'General', u'https://www.cronica.com.ar/seccion/info-general/'), + (u'Mundo', u'https://www.cronica.com.ar/seccion/mundo/'), + (u'Opinion', u'https://www.cronica.com.ar/seccion/opinion/'), + (u'Deportes', u'https://www.cronica.com.ar/seccion/deportes/'), + (u'Cosa de locos', u'https://www.cronica.com.ar/seccion/cosa-de-locos/'), + (u'Espectaculos', u'https://www.diarioshow.com/seccion/espectaculos/'), + ] + + def parse_index(self): + totalfeeds = [] + lfeeds = self.get_feeds() + for feedobj in lfeeds: + feedtitle, feedurl = feedobj + self.report_progress( + 0, + _('Fetching feed') + ' %s...' % + (feedtitle if feedtitle else feedurl) + ) + articles = [] + soup = self.index_to_soup(feedurl) + for item in soup.findAll('a', attrs={'class': 'cover-link'}): + url = self.INDEX + item['href'] + if feedtitle == 'Espectaculos': + url = 'https://www.diarioshow.com' + item['href'] + title = item['title'] + articles.append({ + 'title': title, + 'date': '', + 'url': url, + 'description': '' + }) + totalfeeds.append((feedtitle, articles)) + return totalfeeds diff --git a/recipes/icons/cronica.png b/recipes/icons/cronica.png new file mode 100644 index 0000000000000000000000000000000000000000..4bdebe0fa06960b9f8ae37da7c7bfab61c97bccd GIT binary patch literal 682 zcmV;b0#*HqP)J?(%f08Gd%pw!39~Wb;PVO7CO8FH z>op-T!)a1o0cJya32gkAK%GEQo`DGi*Zep){~-urT^4j_-kz!oN=_fgTeAnVt(4^F zZ$$17;znW!U9DxhD@*&8+8P^c#m17eeZQ9OK9N!>xzU&+{X<&l?3EjhDLObT8%s7; z!p0u}C;-?*x(z5Q*jr8INFUz18X`RdEZusHDcQoxyN`G(%JEc|XJ!_9ckgQFd#H7N zcWc@yYt-r&N0PMEGoYF3qjKXblBD?SF}cy0!Y41t#?r5g9a^2V6FJAT+=b3wWiVZJ zM9$8GS{{9?ReMH}M=vxR2+ApIRP@=1+~v5!!Dcs?Adw8su64VvLdEr&UDv|+HFy4s zQsFtJ7b6M>n`L7qvNr%eNjkLlFNX3v*IDd-h^K4^MTZYi+HwYOz#=&n;%BghG>JWZMA z>