Update El cohete a la luna

Fixes #1781400 [Updated recipe for El cohete a la luna](https://bugs.launchpad.net/calibre/+bug/1781400)
This commit is contained in:
Kovid Goyal 2018-07-12 19:01:52 +05:30
parent 7b480b371a
commit 1b902b7a68
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -2,14 +2,13 @@
# -*- coding: utf-8 -*-
__license__ = 'GPL v3'
__copyright__ = '2017, Darko Miletic <darko.miletic at gmail.com>'
__copyright__ = '2017 - 2018, Darko Miletic <darko.miletic at gmail.com>'
'''
www.elcohetealaluna.com
'''
from calibre.web.feeds.news import BasicNewsRecipe
class elcohetealaluna(BasicNewsRecipe):
title = 'El Cohete a la Luna'
__author__ = 'Darko Miletic'
@ -23,10 +22,15 @@ class elcohetealaluna(BasicNewsRecipe):
language = 'es_AR'
remove_empty_feeds = True
publication_type = 'newsportal'
auto_cleanup = True
auto_cleanup = False
resolve_internal_links = True
compress_news_images = True
masthead_url = 'https://www.elcohetealaluna.com/wp-content/uploads/2018/06/logo-menu.png'
extra_css = """
body{font-family: serif}
body{font-family: Georgia, Times, "Times New Roman", serif}
h1,h2,.post-author-name{font-family: Oswald, sans-serif}
h2{color: gray}
img{margin-top:1em; margin-bottom: 1em; display:block}
"""
@ -34,4 +38,16 @@ class elcohetealaluna(BasicNewsRecipe):
'comment': description, 'tags': category, 'publisher': publisher, 'language': language
}
keep_only_tags=[
dict(name='div', attrs={'class': lambda x: x and 'post-header' in x.split()}),
dict(name='div', attrs={'class': lambda x: x and 'entry-content' in x.split()}),
]
feeds = [(u'Articulos', u'https://www.elcohetealaluna.com/feed/')]
def preprocess_html(self, soup):
for image in soup.findAll(name='img'):
if image.has_key('data-src'):
image['src'] = image['data-src']
return soup