From 8d6bc29107fbda0c6968dad4f42c612a4965faa9 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 18 Jan 2009 11:28:27 -0800 Subject: [PATCH] New recipes for Ambito and El Argentino by Darko Miletic --- src/calibre/gui2/images/news/ambito.png | Bin 0 -> 508 bytes src/calibre/gui2/images/news/elargentino.png | Bin 0 -> 805 bytes src/calibre/web/feeds/recipes/__init__.py | 2 +- .../web/feeds/recipes/recipe_ambito.py | 44 ++++++++++++++ .../web/feeds/recipes/recipe_elargentino.py | 55 ++++++++++++++++++ 5 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 src/calibre/gui2/images/news/ambito.png create mode 100644 src/calibre/gui2/images/news/elargentino.png create mode 100644 src/calibre/web/feeds/recipes/recipe_ambito.py create mode 100644 src/calibre/web/feeds/recipes/recipe_elargentino.py diff --git a/src/calibre/gui2/images/news/ambito.png b/src/calibre/gui2/images/news/ambito.png new file mode 100644 index 0000000000000000000000000000000000000000..e0a6f409cf01248d35328d5a43c3cb78981d2139 GIT binary patch literal 508 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b zK-vS0-A-oPfdtD69Mgd`SU*F|v9*U87#LMOT^vI!PA7j^WASS~BmaYE35hR!E~f=d zdXkm^1UtU}(RMz!q`RO}jg3j+maEvhpRfDvd1_a`UvOe`!sR6@C(kCV)ID3< z3A&u(`B5d!5AS_mzk?TKk_K03;)W|ihYY@eG{x8dIV#}((P>scQ&(Eb?H!g85?RTn zAEXy7KhnQQ(sF|Y5FBB>`BA!I&4bh5?F*JKZs$K|pfSIc_2l__$tfy3C3jc`9G*G5 zS#mq$^!N2iAol@HPwFU}==xDeuOX>nl8U)=?i#i`+CZxke|-9@AGSZ4mpSFEfPQRh z#m|52apDhnj#QuDpQIwy#HPR;q0_-#G$FlVo{)X>>Wva{|C1#O{@k(_IeADx^wORU zCFhfQoG&m|)iE$Mt40*-YTYsbhMsDPYeY$MQEFmIs%{F9U@$T;u+%j$)HSpSF|@QY tGO{u@)iyA&GBB9Bb5agWLvDUbW?Cfy4W~GsL;y7~c)I$ztaD0e0sy%tz9|3z literal 0 HcmV?d00001 diff --git a/src/calibre/gui2/images/news/elargentino.png b/src/calibre/gui2/images/news/elargentino.png new file mode 100644 index 0000000000000000000000000000000000000000..1e3e64d8a512fc1eba6e2352a617e090892befcd GIT binary patch literal 805 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b zK-vS0-A-oPfdtD69Mgd`SU*F|v9*U87?}J#T^vI!PPb0>^%oA5Xr2Ev>-CnB6$^P+ zs){-%WlU|&Mt(v)YoNk!;@Z~E2`7wzg}W~67a~LkIC?fLym(((a*qR z`3dG+H)4eww%+BF4&{EC&%e*Sy5}X=GF6FJViWfWT4`^eP$M{{cymY4v};e*mlT&? z+R3&|_1B|^+gYU(5{o$Yt4)qt|LA(kwDqkWH|#e^vpxxEDp_~#^V(U?bNF@{nsC1K zUYdP=-4qYE(rI0}&ko5M{Z!+g>})gVOLA0GtA8p`kl|6ATh^%rs~2nzz0y()GixS` zhcln6N?TI@@YyRlpsN~wa>}pNOkR-w>f+g$8_n^PJ>5zff?kKV&zWU3WBv!mgs3K; zeV#_EJ-YWau_qT^_tk{-nWc)~NjW$b+ku0P9x7{Mqw)ftc+<48^W-8gQ zRD5u`(K787hR(|0)KBg2s0z)S|9#V+%|~D7^X@v7ruO8Z?&00>xmnX5oZGS8zVrD0 z&zTiFV~@Y#3iFnYQ$1%?<@V5=^TFE%E8Sa;1CyC*iEBhja#3nxNvduNkYF$}FtF4$ zFw`})2r;y@GBU6-G1oRQure^<5sLyPW3YzY{FKbJN&*^!m+OQAH86O(`njxgN@xNA Dhy6&K literal 0 HcmV?d00001 diff --git a/src/calibre/web/feeds/recipes/__init__.py b/src/calibre/web/feeds/recipes/__init__.py index 8b0165b184..e6bcdaed9c 100644 --- a/src/calibre/web/feeds/recipes/__init__.py +++ b/src/calibre/web/feeds/recipes/__init__.py @@ -22,7 +22,7 @@ recipe_modules = ['recipe_' + r for r in ( 'time_magazine', 'endgadget', 'fudzilla', 'nspm_int', 'nspm', 'pescanik', 'spiegel_int', 'themarketticker', 'tomshardware', 'xkcd', 'ftd', 'zdnet', 'joelonsoftware', 'telepolis', 'common_dreams', 'nin', 'tomshardware_de', - 'pagina12', 'infobae', + 'pagina12', 'infobae', 'ambito', 'elargentino', )] import re, imp, inspect, time, os diff --git a/src/calibre/web/feeds/recipes/recipe_ambito.py b/src/calibre/web/feeds/recipes/recipe_ambito.py new file mode 100644 index 0000000000..56528c27c0 --- /dev/null +++ b/src/calibre/web/feeds/recipes/recipe_ambito.py @@ -0,0 +1,44 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = '2008, Darko Miletic ' +''' +ambito.com +''' + + +from calibre.web.feeds.news import BasicNewsRecipe + +class Ambito(BasicNewsRecipe): + title = 'Ambito.com' + __author__ = 'Darko Miletic' + description = 'Informacion Libre las 24 horas' + oldest_article = 2 + max_articles_per_feed = 100 + no_stylesheets = True + use_embedded_content = False + encoding = 'iso--8859-1' + cover_url = 'http://www.ambito.com/img/logo_.jpg' + + html2lrf_options = [ + '--comment' , description + , '--category' , 'news, Argentina' + , '--publisher' , title + ] + + feeds = [ + (u'Principales Noticias', u'http://www.ambito.com/rss/noticiasp.asp' ) + ,(u'Economia' , u'http://www.ambito.com/rss/noticias.asp?S=Econom%EDa' ) + ,(u'Politica' , u'http://www.ambito.com/rss/noticias.asp?S=Pol%EDtica' ) + ,(u'Informacion General' , u'http://www.ambito.com/rss/noticias.asp?S=Informaci%F3n%20General') + ,(u'Agro' , u'http://www.ambito.com/rss/noticias.asp?S=Agro' ) + ,(u'Internacionales' , u'http://www.ambito.com/rss/noticias.asp?S=Internacionales' ) + ,(u'Deportes' , u'http://www.ambito.com/rss/noticias.asp?S=Deportes' ) + ,(u'Espectaculos' , u'http://www.ambito.com/rss/noticias.asp?S=Espect%E1culos' ) + ,(u'Tecnologia' , u'http://www.ambito.com/rss/noticias.asp?S=Tecnologia' ) + ,(u'Salud' , u'http://www.ambito.com/rss/noticias.asp?S=Salud' ) + ,(u'Ambito Nacional' , u'http://www.ambito.com/rss/noticias.asp?S=Ambito%20Nacional' ) + ] + + def print_version(self, url): + return url.replace('http://www.ambito.com/noticia.asp?','http://www.ambito.com/noticias/imprimir.asp?') diff --git a/src/calibre/web/feeds/recipes/recipe_elargentino.py b/src/calibre/web/feeds/recipes/recipe_elargentino.py new file mode 100644 index 0000000000..7aee232787 --- /dev/null +++ b/src/calibre/web/feeds/recipes/recipe_elargentino.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = '2008, Darko Miletic ' +''' +elargentino.com +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class ElArgentino(BasicNewsRecipe): + title = 'ElArgentino.com' + __author__ = 'Darko Miletic' + description = 'Informacion Libre las 24 horas' + oldest_article = 2 + max_articles_per_feed = 100 + no_stylesheets = True + use_embedded_content = False + encoding = 'utf8' + cover_url = 'http://www.elargentino.com/TemplateWeb/MediosFooter/tapa_elargentino.png' + + html2lrf_options = [ + '--comment' , description + , '--category' , 'news, Argentina' + , '--publisher' , 'ElArgentino.com' + ] + + remove_tags = [ + dict(name='div', attrs={'id':'noprint' }) + ,dict(name='div', attrs={'class':'encabezadoImprimir'}) + ,dict(name='a' , attrs={'target':'_blank' }) + ] + + feeds = [ + (u'Portada' , u'http://www.elargentino.com/Highlights.aspx?Content-Type=text/xml&ChannelDesc=Home' ) + ,(u'Pais' , u'http://www.elargentino.com/Highlights.aspx?ParentType=Section&ParentId=112&Content-Type=text/xml&ChannelDesc=Pa%C3%ADs' ) + ,(u'Economia' , u'http://www.elargentino.com/Highlights.aspx?ParentType=Section&ParentId=107&Content-Type=text/xml&ChannelDesc=Econom%C3%ADa' ) + ,(u'Mundo' , u'http://www.elargentino.com/Highlights.aspx?ParentType=Section&ParentId=113&Content-Type=text/xml&ChannelDesc=Mundo' ) + ,(u'Tecnologia' , u'http://www.elargentino.com/Highlights.aspx?ParentType=Section&ParentId=118&Content-Type=text/xml&ChannelDesc=Tecnolog%C3%ADa' ) + ,(u'Espectaculos', u'http://www.elargentino.com/Highlights.aspx?ParentType=Section&ParentId=114&Content-Type=text/xml&ChannelDesc=Espect%C3%A1culos') + ,(u'Deportes' , u'http://www.elargentino.com/Highlights.aspx?ParentType=Section&ParentId=106&Content-Type=text/xml&ChannelDesc=Deportes' ) + ,(u'Sociedad' , u'http://www.elargentino.com/Highlights.aspx?ParentType=Section&ParentId=109&Content-Type=text/xml&ChannelDesc=Sociedad' ) + ,(u'Entrevistas' , u'http://www.elargentino.com/Highlights.aspx?ParentType=Section&ParentId=115&Content-Type=text/xml&ChannelDesc=Entrevistas' ) + ] + + def print_version(self, url): + main, sep, article_part = url.partition('/nota-') + article_id, rsep, rrest = article_part.partition('-') + return u'http://www.elargentino.com/Impresion.aspx?Id=' + article_id + + def preprocess_html(self, soup): + mtag = '' + soup.head.insert(0,mtag) + soup.prettify() + return soup