| 1 |
# -*- mode: python -*- |
| 2 |
# -*- coding: utf-8 -*- |
| 3 |
|
| 4 |
__license__ = 'GPL v3' |
| 5 |
__copyright__ = '2017 - 2018, Darko Miletic <darko.miletic at gmail.com>' |
| 6 |
''' |
| 7 |
www.elcohetealaluna.com |
| 8 |
''' |
| 9 |
|
| 10 |
from calibre.web.feeds.news import BasicNewsRecipe |
| 11 |
|
| 12 |
|
| 13 |
class elcohetealaluna(BasicNewsRecipe): |
| 14 |
title = 'El Cohete a la Luna' |
| 15 |
__author__ = 'Darko Miletic' |
| 16 |
description = 'El nuevo portal de Horacio Verbitsky' |
| 17 |
publisher = 'Horacio Verbitsky' |
| 18 |
category = 'news, politics, Argentina' |
| 19 |
oldest_article = 7 |
| 20 |
no_stylesheets = True |
| 21 |
encoding = 'utf8' |
| 22 |
use_embedded_content = False |
| 23 |
language = 'es_AR' |
| 24 |
remove_empty_feeds = True |
| 25 |
publication_type = 'newsportal' |
| 26 |
auto_cleanup = False |
| 27 |
resolve_internal_links = True |
| 28 |
compress_news_images = True |
| 29 |
masthead_url = 'https://www.elcohetealaluna.com/wp-content/uploads/2018/06/logo-menu.png' |
| 30 |
|
| 31 |
extra_css = ''' |
| 32 |
body{font-family: Georgia, Times, "Times New Roman", serif} |
| 33 |
h1,h2,.post-author-name{font-family: Oswald, sans-serif} |
| 34 |
h2{color: gray} |
| 35 |
img{margin-top:1em; margin-bottom: 1em; display:block} |
| 36 |
''' |
| 37 |
|
| 38 |
conversion_options = {'comment': description, 'tags': category, 'publisher': publisher, 'language': language} |
| 39 |
|
| 40 |
keep_only_tags = [ |
| 41 |
dict(name='div', attrs={'class': lambda x: x and 'post-header' in x.split()}), |
| 42 |
dict(name='div', attrs={'class': lambda x: x and 'entry-content' in x.split()}), |
| 43 |
] |
| 44 |
|
| 45 |
feeds = [('Articulos', 'https://www.elcohetealaluna.com/feed/')] |
| 46 |
|
| 47 |
def preprocess_html(self, soup): |
| 48 |
for image in soup.findAll(name='img', attrs={'data-src': True}): |
| 49 |
image['src'] = image['data-src'] |
| 50 |
return soup |