mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Update iprofessional
Fixes #1195826 [Updated recipe for iprofessional](https://bugs.launchpad.net/calibre/+bug/1195826)
This commit is contained in:
parent
54a9a7c98e
commit
4b4b89bc6e
@ -1,5 +1,4 @@
|
|||||||
__license__ = 'GPL v3'
|
__copyright__ = '2011-2013, Darko Miletic <darko.miletic at gmail.com>'
|
||||||
__copyright__ = '2011, Darko Miletic <darko.miletic at gmail.com>'
|
|
||||||
'''
|
'''
|
||||||
www.iprofesional.com
|
www.iprofesional.com
|
||||||
'''
|
'''
|
||||||
@ -19,13 +18,15 @@ class iProfesional(BasicNewsRecipe):
|
|||||||
use_embedded_content = False
|
use_embedded_content = False
|
||||||
language = 'es_AR'
|
language = 'es_AR'
|
||||||
remove_empty_feeds = True
|
remove_empty_feeds = True
|
||||||
publication_type = 'nesportal'
|
publication_type = 'newsportal'
|
||||||
masthead_url = 'http://www.iprofesional.com/img/logo-iprofesional.png'
|
masthead_url = 'http://www.iprofesional.com/img/header/logoiprofesional.png'
|
||||||
extra_css = """
|
extra_css = """
|
||||||
body{font-family: Arial,Helvetica,sans-serif }
|
body{font-family: 'Droid Sans',Arial,sans-serif }
|
||||||
img{margin-bottom: 0.4em; display:block}
|
img{margin-bottom: 0.4em; display:block}
|
||||||
.titulo-interior{font-family: Georgia,"Times New Roman",Times,serif}
|
.titulo{font-family: WhitneyBoldWhitneyBold,Arial,Helvetica,sans-serif; color: blue}
|
||||||
.autor-nota{font-size: small; font-weight: bold; font-style: italic; color: gray}
|
.fecha-archivo{font-weight: bold; color: rgb(205, 150, 24)}
|
||||||
|
.description{font-weight: bold; color: gray }
|
||||||
|
.firma{font-size: small}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
conversion_options = {
|
conversion_options = {
|
||||||
@ -35,27 +36,21 @@ class iProfesional(BasicNewsRecipe):
|
|||||||
, 'language' : language
|
, 'language' : language
|
||||||
}
|
}
|
||||||
|
|
||||||
keep_only_tags = [dict(attrs={'class':['fecha','interior-nota']})]
|
keep_only_tags = [dict(attrs={'class':'desarrollo'})]
|
||||||
|
remove_tags = [dict(name=['meta','link','base','embed','object','iframe'])]
|
||||||
remove_tags = [
|
|
||||||
dict(name=['meta','link','base','embed','object','iframe'])
|
|
||||||
,dict(attrs={'class':['menu-imprimir','guardarNota','IN-widget','fin','permalink']})
|
|
||||||
]
|
|
||||||
remove_attributes=['lang','xmlns:og','xmlns:fb']
|
|
||||||
|
|
||||||
|
|
||||||
feeds = [
|
feeds = [
|
||||||
(u'Ultimas noticias' , u'http://feeds.feedburner.com/iprofesional-principales-noticias')
|
(u'Ultimas noticias' , u'http://feeds.feedburner.com/iprofesional-principales-noticias')
|
||||||
,(u'Finanzas' , u'http://feeds.feedburner.com/iprofesional-finanzas' )
|
,(u'Finanzas' , u'http://feeds.feedburner.com/iprofesional-finanzas')
|
||||||
,(u'Impuestos' , u'http://feeds.feedburner.com/iprofesional-impuestos' )
|
,(u'Impuestos' , u'http://feeds.feedburner.com/iprofesional-impuestos')
|
||||||
,(u'Negocios' , u'http://feeds.feedburner.com/iprofesional-economia' )
|
,(u'Negocios' , u'http://feeds.feedburner.com/iprofesional-economia')
|
||||||
,(u'Comercio Exterior' , u'http://feeds.feedburner.com/iprofesional-comercio-exterior' )
|
,(u'Comercio Exterior' , u'http://feeds.feedburner.com/iprofesional-comercio-exterior')
|
||||||
,(u'Tecnologia' , u'http://feeds.feedburner.com/iprofesional-tecnologia' )
|
,(u'Tecnologia' , u'http://feeds.feedburner.com/iprofesional-tecnologia')
|
||||||
,(u'Management' , u'http://feeds.feedburner.com/iprofesional-managment' )
|
,(u'Management' , u'http://feeds.feedburner.com/iprofesional-managment')
|
||||||
,(u'Marketing' , u'http://feeds.feedburner.com/iprofesional-marketing' )
|
,(u'Marketing' , u'http://feeds.feedburner.com/iprofesional-marketing')
|
||||||
,(u'Legales' , u'http://feeds.feedburner.com/iprofesional-legales' )
|
,(u'Legales' , u'http://feeds.feedburner.com/iprofesional-legales')
|
||||||
,(u'Autos' , u'http://feeds.feedburner.com/iprofesional-autos' )
|
,(u'Autos' , u'http://feeds.feedburner.com/iprofesional-autos')
|
||||||
,(u'Vinos' , u'http://feeds.feedburner.com/iprofesional-vinos-bodegas' )
|
,(u'Vinos' , u'http://feeds.feedburner.com/iprofesional-vinos-bodegas')
|
||||||
]
|
]
|
||||||
|
|
||||||
def preprocess_html(self, soup):
|
def preprocess_html(self, soup):
|
||||||
@ -64,16 +59,17 @@ class iProfesional(BasicNewsRecipe):
|
|||||||
for item in soup.findAll('a'):
|
for item in soup.findAll('a'):
|
||||||
limg = item.find('img')
|
limg = item.find('img')
|
||||||
if item.string is not None:
|
if item.string is not None:
|
||||||
str = item.string
|
str = item.string
|
||||||
item.replaceWith(str)
|
item.replaceWith(str)
|
||||||
else:
|
else:
|
||||||
if limg:
|
if limg:
|
||||||
item.name = 'div'
|
item.name = 'div'
|
||||||
item.attrs = []
|
item.attrs = []
|
||||||
else:
|
else:
|
||||||
str = self.tag_to_string(item)
|
str = self.tag_to_string(item)
|
||||||
item.replaceWith(str)
|
item.replaceWith(str)
|
||||||
for item in soup.findAll('img'):
|
for item in soup.findAll('img'):
|
||||||
if not item.has_key('alt'):
|
if 'alt' not in item:
|
||||||
item['alt'] = 'image'
|
item['alt'] = 'image'
|
||||||
return soup
|
return soup
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user