From 1d423c8d018a764e638db016cf232cf1f6e8883d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 13 May 2011 14:03:16 -0600 Subject: [PATCH] iProfesional by DM. Fixes #782369 (New recipe for iprofessional) --- recipes/icons/iprofesional.png | Bin 0 -> 1088 bytes recipes/iprofesional.recipe | 79 +++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 recipes/icons/iprofesional.png create mode 100644 recipes/iprofesional.recipe diff --git a/recipes/icons/iprofesional.png b/recipes/icons/iprofesional.png new file mode 100644 index 0000000000000000000000000000000000000000..fa52d7dbfc62b03cd7076bf53a04843bbb6c5223 GIT binary patch literal 1088 zcmeHE`AgGr7#<2Gig{!xCZ;ARc?>HuN{wokE18>anW$8jQISWb+q@5wwoFGNdCiIf zHJMJ(oCldobBfD6@@gK;P4lG8WBVST&!?|{MZfgG`@X+CFYog_ub9ocY-#RjPNUH* znIVjDYFh7=nJLvheXJsAG*cQolp72IvD?Zc6mg<*`H6^hS%=ctdGBmgmaIc{Ls;g= z5)$(YUUD%B31fvT3BlEPQF(0_0uTWNcl2M>)ATStJxr)jj{5V`a72KK2J!3W7uE9b zQ(Ag>CRX7>anT>G51ZfIGXz&h4VA70f(4awteFcT3HN|}+5GXjMSgM3sfeuF78NhC zC_L%q!rH1_q28%-F;+Swh>-{(NKR<9V0jQhWFScFYq5G*^Lbz_v!tFdtmCQz&I6Ir zxC;;t5V^FvL21M)-F-Nz+NE{0&<$o=+xo@~vP*_4=f+Mo*wjK2#H5x&iodO+EQKc& zQeqLdx&7uCM&RQ!dW3CtsV1@|AI4{v&U1xQOG)HWQ;yv}$($y5+jcfkJZF1tyNQvs=9V6-@;EaB+p{Wa z)5=}r85b?4%mQ-X#q~%c-}dty<3#fbQ@dfAEox7;5Kb9~ZL%14fPGgIu#yv(=m zM&F8XXpYpGXRMgonb30zeoqend_E+vbN8nuJj(d=>yGo2z;AvfrFxx0DPAhGdFY*W zJWATppl2R?+*=J*A+3UW&WNb^ux8-J3CZ2DbN<&_VVT? z2T9AO)1?{{o54<(8LQN}Sbl)ax7$Hu#+(ivn5=WgT<4k6yzS!~Ifw V=ED7RsqTCEGlN--#tS#|{{p^Vq>%ss literal 0 HcmV?d00001 diff --git a/recipes/iprofesional.recipe b/recipes/iprofesional.recipe new file mode 100644 index 0000000000..e8edbbc7a3 --- /dev/null +++ b/recipes/iprofesional.recipe @@ -0,0 +1,79 @@ +__license__ = 'GPL v3' +__copyright__ = '2011, Darko Miletic ' +''' +www.iprofesional.com +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class iProfesional(BasicNewsRecipe): + title = 'iProfesional.com' + __author__ = 'Darko Miletic' + description = 'Las ultimas noticias sobre profesionales' + publisher = 'Emprendimientos Corporativos S.A.' + category = 'news, IT, impuestos, negocios, politics, Argentina' + oldest_article = 2 + max_articles_per_feed = 200 + no_stylesheets = True + encoding = 'utf8' + use_embedded_content = False + language = 'es_AR' + remove_empty_feeds = True + publication_type = 'nesportal' + masthead_url = 'http://www.iprofesional.com/img/logo-iprofesional.png' + extra_css = """ + body{font-family: Arial,Helvetica,sans-serif } + img{margin-bottom: 0.4em; display:block} + .titulo-interior{font-family: Georgia,"Times New Roman",Times,serif} + .autor-nota{font-size: small; font-weight: bold; font-style: italic; color: gray} + """ + + conversion_options = { + 'comment' : description + , 'tags' : category + , 'publisher' : publisher + , 'language' : language + } + + keep_only_tags = [dict(attrs={'class':['fecha','interior-nota']})] + + 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 = [ + (u'Ultimas noticias' , u'http://feeds.feedburner.com/iprofesional-principales-noticias') + ,(u'Finanzas' , u'http://feeds.feedburner.com/iprofesional-finanzas' ) + ,(u'Impuestos' , u'http://feeds.feedburner.com/iprofesional-impuestos' ) + ,(u'Negocios' , u'http://feeds.feedburner.com/iprofesional-economia' ) + ,(u'Comercio Exterior' , u'http://feeds.feedburner.com/iprofesional-comercio-exterior' ) + ,(u'Tecnologia' , u'http://feeds.feedburner.com/iprofesional-tecnologia' ) + ,(u'Management' , u'http://feeds.feedburner.com/iprofesional-managment' ) + ,(u'Marketing' , u'http://feeds.feedburner.com/iprofesional-marketing' ) + ,(u'Legales' , u'http://feeds.feedburner.com/iprofesional-legales' ) + ,(u'Autos' , u'http://feeds.feedburner.com/iprofesional-autos' ) + ,(u'Vinos' , u'http://feeds.feedburner.com/iprofesional-vinos-bodegas' ) + ] + + def preprocess_html(self, soup): + for item in soup.findAll(style=True): + del item['style'] + for item in soup.findAll('a'): + limg = item.find('img') + if item.string is not None: + str = item.string + item.replaceWith(str) + else: + if limg: + item.name = 'div' + item.attrs = [] + else: + str = self.tag_to_string(item) + item.replaceWith(str) + for item in soup.findAll('img'): + if not item.has_key('alt'): + item['alt'] = 'image' + return soup