mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Update Buenos Aires Economico. Fixes #1653092 [Updated recipe for Buenos Aires Economico](https://bugs.launchpad.net/calibre/+bug/1653092)
This commit is contained in:
parent
94d7bce604
commit
ef16647400
@ -1,9 +1,12 @@
|
|||||||
|
#!/usr/bin/env python2
|
||||||
|
# -*- mode: python -*-
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2009-2011, Darko Miletic <darko.miletic at gmail.com>'
|
__copyright__ = '2009-2016, Darko Miletic <darko.miletic at gmail.com>'
|
||||||
'''
|
'''
|
||||||
www.diariobae.com
|
www.diariobae.com
|
||||||
'''
|
'''
|
||||||
from calibre import strftime
|
|
||||||
from calibre.web.feeds.news import BasicNewsRecipe
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
|
||||||
|
|
||||||
@ -19,41 +22,32 @@ class BsAsEconomico(BasicNewsRecipe):
|
|||||||
use_embedded_content = False
|
use_embedded_content = False
|
||||||
encoding = 'utf-8'
|
encoding = 'utf-8'
|
||||||
language = 'es_AR'
|
language = 'es_AR'
|
||||||
cover_url = strftime(
|
masthead_url = 'http://static.cronica.com.ar/FileAccessHandler.ashx?code=635959869637084622'
|
||||||
'http://www.diariobae.com/imgs_portadas/%Y%m%d_portadasBAE.jpg')
|
|
||||||
masthead_url = 'http://www.diariobae.com/img/logo_bae.png'
|
|
||||||
remove_empty_feeds = True
|
remove_empty_feeds = True
|
||||||
publication_type = 'newspaper'
|
publication_type = 'newspaper'
|
||||||
extra_css = """
|
extra_css = """
|
||||||
body{font-family: Georgia,"Times New Roman",Times,serif}
|
body{font-family: Georgia,"Times New Roman",Times,serif}
|
||||||
#titulo{font-size: x-large}
|
|
||||||
#epi{font-size: small; font-style: italic; font-weight: bold}
|
|
||||||
img{display: block; margin-top: 1em}
|
img{display: block; margin-top: 1em}
|
||||||
"""
|
"""
|
||||||
conversion_options = {
|
conversion_options = {
|
||||||
'comment': description, 'tags': category, 'publisher': publisher, 'language': language
|
'comment' : description,
|
||||||
|
'tags' : category,
|
||||||
|
'publisher': publisher,
|
||||||
|
'language' : language
|
||||||
}
|
}
|
||||||
|
|
||||||
remove_tags_before = dict(attrs={'id': 'titulo'})
|
keep_only_tags = [dict(name='div', attrs={'class':'post'})]
|
||||||
remove_tags_after = dict(attrs={'id': 'autor'})
|
|
||||||
remove_tags = [
|
remove_tags = [
|
||||||
dict(name=['meta', 'base', 'iframe', 'link', 'lang']), dict(
|
dict(name=['meta', 'base', 'iframe', 'link', 'lang'])
|
||||||
attrs={'id': 'barra_tw'})
|
,dict(attrs={'class':'pdfprnt-bottom-right'})
|
||||||
]
|
]
|
||||||
remove_attributes = ['data-count', 'data-via']
|
|
||||||
|
|
||||||
feeds = [
|
feeds = [(u'Articles', u'http://www.diariobae.com/feed/getfeed')]
|
||||||
|
|
||||||
(u'Argentina', u'http://www.diariobae.com/rss/argentina.xml'),
|
def get_cover_url(self):
|
||||||
(u'Valores', u'http://www.diariobae.com/rss/valores.xml'),
|
cover = None
|
||||||
(u'Finanzas', u'http://www.diariobae.com/rss/finanzas.xml'),
|
soup = self.index_to_soup('http://www.diariobae.com/')
|
||||||
(u'Negocios', u'http://www.diariobae.com/rss/negocios.xml'),
|
tag = soup.find('a', rel='lightbox[tapa]', href=True)
|
||||||
(u'Mundo', u'http://www.diariobae.com/rss/mundo.xml'),
|
if tag:
|
||||||
(u'5 dias', u'http://www.diariobae.com/rss/5dias.xml'),
|
cover = tag['href']
|
||||||
(u'Espectaculos', u'http://www.diariobae.com/rss/espectaculos.xml')
|
return cover
|
||||||
]
|
|
||||||
|
|
||||||
def preprocess_html(self, soup):
|
|
||||||
for item in soup.findAll(style=True):
|
|
||||||
del item['style']
|
|
||||||
return soup
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user