From fad5109de6adb55205e73d6bd24bdec545b84626 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 31 Dec 2008 08:23:15 -0800 Subject: [PATCH] Added recipes: NSPM, NSPM in english, The market ticker, Tom's Hardware, Spiegel international (in english), Pescanik Updated recipes: Vreme, B92, Politika, Novosti, jutarnji, la nacion, Clarin, Blic, Danas --- src/calibre/gui2/images/news/clarin.png | Bin 0 -> 330 bytes src/calibre/gui2/images/news/lanacion.png | Bin 0 -> 318 bytes src/calibre/gui2/images/news/nspm.png | Bin 0 -> 1016 bytes src/calibre/gui2/images/news/nspm_int.png | Bin 0 -> 1016 bytes src/calibre/gui2/images/news/pescanik.png | Bin 0 -> 1087 bytes src/calibre/gui2/images/news/spiegel_int.png | Bin 0 -> 811 bytes .../gui2/images/news/themarketticker.png | Bin 0 -> 607 bytes src/calibre/gui2/images/news/tomshardware.png | Bin 0 -> 992 bytes src/calibre/web/feeds/recipes/__init__.py | 3 +- src/calibre/web/feeds/recipes/b92.py | 39 +++++++----- src/calibre/web/feeds/recipes/blic.py | 10 ++- src/calibre/web/feeds/recipes/clarin.py | 11 +++- src/calibre/web/feeds/recipes/danas.py | 29 +++++---- src/calibre/web/feeds/recipes/jutarnji.py | 27 +++++--- src/calibre/web/feeds/recipes/lanacion.py | 22 ++++++- src/calibre/web/feeds/recipes/novosti.py | 15 +++-- src/calibre/web/feeds/recipes/nspm.py | 8 ++- src/calibre/web/feeds/recipes/nspm_int.py | 37 +++++++++++ src/calibre/web/feeds/recipes/pescanik.py | 35 +++++++++++ src/calibre/web/feeds/recipes/politika.py | 15 +++-- src/calibre/web/feeds/recipes/spiegel_int.py | 34 ++++++++++ .../web/feeds/recipes/themarketticker.py | 23 +++++++ src/calibre/web/feeds/recipes/tomshardware.py | 58 ++++++++++++++++++ src/calibre/web/feeds/recipes/vreme.py | 19 ++++-- 24 files changed, 326 insertions(+), 59 deletions(-) create mode 100644 src/calibre/gui2/images/news/clarin.png create mode 100644 src/calibre/gui2/images/news/lanacion.png create mode 100644 src/calibre/gui2/images/news/nspm.png create mode 100644 src/calibre/gui2/images/news/nspm_int.png create mode 100644 src/calibre/gui2/images/news/pescanik.png create mode 100644 src/calibre/gui2/images/news/spiegel_int.png create mode 100644 src/calibre/gui2/images/news/themarketticker.png create mode 100644 src/calibre/gui2/images/news/tomshardware.png create mode 100644 src/calibre/web/feeds/recipes/nspm_int.py create mode 100644 src/calibre/web/feeds/recipes/pescanik.py create mode 100644 src/calibre/web/feeds/recipes/spiegel_int.py create mode 100644 src/calibre/web/feeds/recipes/themarketticker.py create mode 100644 src/calibre/web/feeds/recipes/tomshardware.py diff --git a/src/calibre/gui2/images/news/clarin.png b/src/calibre/gui2/images/news/clarin.png new file mode 100644 index 0000000000000000000000000000000000000000..f08bc3e5acdf925a067d44b639ce4f43fcaaad5b GIT binary patch literal 330 zcmeAS@N?(olHy`uVBq!ia0vp^LO?9Q!3HFy+4N(86kC$Fy9>iV5PU6hr3om)S>O>_ z45U54*zIJt9Z0aOz%d<2gY`2A^6{Jia*91&978Nlubt@4bwGiK^||N!`lltqQQFVg z_w@=rGU(jU**NjYfq8b!5`oD~KU^g}7QFl?w8bDMAZ2N<3&*X4Pxg2_o}Te;b|7PD zQO=fRH^q!?7sF@wEeqW8q{RK6e`Trbgua)dH@%r(F`d%MefI7YLjm)yXf4jUuTE?Q zTCZB-8c~v5l$uzQs+$5N7>o=IEOZTxbd3!|49u-ejjc=!bqy@63=9}2EVv2Nkei>9 YnN~?aL!9EZw?GXHp00i_>zopr001Xx4*&oF literal 0 HcmV?d00001 diff --git a/src/calibre/gui2/images/news/lanacion.png b/src/calibre/gui2/images/news/lanacion.png new file mode 100644 index 0000000000000000000000000000000000000000..7ec4c32eadfb6e077875b3801545666b26217a22 GIT binary patch literal 318 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%b@U_I1CZGssfk$L9 zkoEv$x0Bg+Ai=T%$8;bK*3S@gZ0%tnC*9MbP0l+XkKQYd61 literal 0 HcmV?d00001 diff --git a/src/calibre/gui2/images/news/nspm.png b/src/calibre/gui2/images/news/nspm.png new file mode 100644 index 0000000000000000000000000000000000000000..ff15e31325b499e3e9ea34dc93be7e10e9a83ae9 GIT binary patch literal 1016 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%b@U_I1CZGssfk$L9 zkoEv$x0Bg+Ai=T%$8;bK*3S@gZ0%tN24+Q17sn8b)47wqGh|X38utI6fBf8=Gil|M zbLGrT4UY+}-L}+KmFsIGZ!1UC1R-tRtBcw9ay&Y_I^?9I&CeD6K_3NKxSjaDRH8O6 zl@QIoV$*%>?weU9@y44!|2RHbA$R}h#u+7v-lSqgjQ& z+0kvc`3#=_cX+#pH@9%=jjbMg_&%Ky`t{9m#$UGGRiej#ACH}1_c-QC&eN^p-}~*g z>-HLC*3@&>zJI%9FKbJ*!rj28sa&&Irs^;3;W5fqSfg|Cj!w~%^IvUmU!Ny``Jx%Tl0&HE=%{6|hGvC+h^tz2P(OKwXvGN^_gF_yuMlI}Zby-<6>}QzefU^hc}>bL$Rg6@tlC%Q6Qv8E?+$pn ze_`%|oC}v3_Ad8OioL*EwXH!yf`N0dAKT07#0e=pAqSg|in=Ur-6VVE%yEfMg^fO! zUYcJFVK-VJR?ob?H|?fNZS(z;e-5+z9oKTI{bHGvAgvSAwxPA+h2x~M=90yYHdd~4 z3>VyVyJO{L^Ig|7xB1Q8-}fh-dw4vad+C~GzrP)*>fI4`^xe%ijsLEfzI47$ee~5e zWw~qBOZ5xMSN84xaQD*DJB`27Qt~ni6n`I?tZ%}7d(n{#2H);DMyy@@>-PlDt~|>Z z*6xAR|GV_u_g}%H%Qf-qnT^wRj<54>__MJ2{qsJX(nXT99glY>Y;OC+WMbSb=(Huu zaY_|u=%K4?D|#OXtM4km|MO|7G3(S<7oN@ZkMFG8X)!Uk-SzZIfp)o#0#{z%+r(#A zu*$-+@RH`U)8>0V+8^3Bef^&wzn9$mIB}O>*^_6LyF+3w?weU9@y44!|2RHbA$R}h#u+7v-lSqgjQ& z+0kvc`3#=_cX+#pH@9%=jjbMg_&%Ky`t{9m#$UGGRiej#ACH}1_c-QC&eN^p-}~*g z>-HLC*3@&>zJI%9FKbJ*!rj28sa&&Irs^;3;W5fqSfg|Cj!w~%^IvUmU!Ny``Jx%Tl0&HE=%{6|hGvC+h^tz2P(OKwXvGN^_gF_yuMlI}Zby-<6>}QzefU^hc}>bL$Rg6@tlC%Q6Qv8E?+$pn ze_`%|oC}v3_Ad8OioL*EwXH!yf`N0dAKT07#0e=pAqSg|in=Ur-6VVE%yEfMg^fO! zUYcJFVK-VJR?ob?H|?fNZS(z;e-5+z9oKTI{bHGvAgvSAwxPA+h2x~M=90yYHdd~4 z3>VyVyJO{L^Ig|7xB1Q8-}fh-dw4vad+C~GzrP)*>fI4`^xe%ijsLEfzI47$ee~5e zWw~qBOZ5xMSN84xaQD*DJB`27Qt~ni6n`I?tZ%}7d(n{#2H);DMyy@@>-PlDt~|>Z z*6xAR|GV_u_g}%H%Qf-qnT^wRj<54>__MJ2{qsJX(nXT99glY>Y;OC+WMbSb=(Huu zaY_|u=%K4?D|#OXtM4km|MO|7G3(S<7oN@ZkMFG8X)!Uk-SzZIfp)o#0#{z%+r(#A zu*$-+@RH`U)8>0V+8^3Bef^&wzn9$mIB}O>*^_6LyF+3wB|mLRdT*IRD&D1$u_F zz$3C4NPB>>+sSM@kYHJXV>*xq=NyKZV`~osIeDHgjv*44OV6L?V^-vF2o!Ow?D+qG zyK-jka^E)D^g`wh|Jdd={1iVi_uT^KwJ&&&RGI%|a+$lCP3FO!;2*3{ETofW&q$1j za(n$OZ*Q+`8_zY3C8}9%iR>Tea^Fdu&`~U0*>WK1;^%fQd;9M*xo14&5uT9q>pIY8 z)e_f;lH{V)#FA9q6d=K1WME*SYiOivY#3r-Ze?n0Wn!pnU}0roz&K&SO_+w<{FKbJ XN&*_<6tBGnYGCkm^>bP0l+XkK8rOI& literal 0 HcmV?d00001 diff --git a/src/calibre/gui2/images/news/spiegel_int.png b/src/calibre/gui2/images/news/spiegel_int.png new file mode 100644 index 0000000000000000000000000000000000000000..700cdb4d337757ef0deb017193122b3393ab9367 GIT binary patch literal 811 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%b@U_I1CZGssfk$L9 zkoEv$x0Bg+Ai=T%$8;bK*3S@gZ0%tN2Br{C7sn8b)1{LfJwy^kj@LhabLQN(9eG-h zb~$snJ=vu9a;<_BYcNMwi=J20m4)6yVd6)d6tLxEzW0!3$MJ$sN!#EF}3D?V$`Rf zR$A@96tWXt(jKOBeJf*_;C1@rw)>9UEL=;TF!so9GJc$quK!@)#nv}^CzppOf2cm4 z_TuF`)&o&gW&S;!?E2;XGu7z4+G4oq5Zq@ID=kb(&vtuZE zJ+{q2U;Zf3s%E<>BdftMAtX}px8w1*ep$?0Rm_BZdi*y`^(lJ&EA-g?+9xi-sje?V zcNx?#ZJBD!y=T|1TXw5ACGDPS?CM{yOE* zJod6;Vdq5tGXHg&DthtOr6>dWYPRE<^Z5L4|9s(eh3(y*O5X^}V4!1wc8Js@2NxUL z?e9NP)AHhwIYZMzt21jnb248>RQ_k!#O`2hC_M2RFtMqYxJHyD7o{ear0S*s2?iqr z0}EY4BVA*|5Cd~7Q)4R=LtO(4D+2?@2@7t*H00)|WTsUT&=9A1?JZCPgQu&X%Q~lo FCIAi?R@DFi literal 0 HcmV?d00001 diff --git a/src/calibre/gui2/images/news/themarketticker.png b/src/calibre/gui2/images/news/themarketticker.png new file mode 100644 index 0000000000000000000000000000000000000000..488ee3c1a7f93cd875154125c57fc5aee615db9d GIT binary patch literal 607 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%b@U_I1CZGssfk$L9 zkoEv$x0Bg+Ai=T%$8;bK*3S@gZ0%tN2F4Cg7sn8b(|afB`a}mxw9PNR)|h3uL_J~? zOLNY#NoOa9B|A(AacDZ0EA^!9SZ;#W1?gp{+ip6!#vU~dpQs=p9qGaM{reta^F|Yc z7iwj9PX69&f1m$Pzxw;H=bx;(9r|d_p_ec3cegwYu+(5*x<2lnc7lA5om8Mz`>xnG z+uz@rp5)^&eY%#J`IP;YwqX&s?=9QVcH#Yf!1 ze))X-uaX@@3z1BI;FX5ukGI=-_*I=Hidad zu2yaM^y3HHe(SduVUOl)@{49T`mC+!Lh0g#20LV9wrz`AYtpr3v+-1RcG0jmZ(iJ* zH9Pinb?d_b#lGWroJ2Hd&J5hPW5w#9l|R3JYUYxCzsco1c=IR!KlZoZ_{&Kn)C@u6{1- HoD!M<*7X9P literal 0 HcmV?d00001 diff --git a/src/calibre/gui2/images/news/tomshardware.png b/src/calibre/gui2/images/news/tomshardware.png new file mode 100644 index 0000000000000000000000000000000000000000..c31412474caf6291120957e4228b463ecf420bf7 GIT binary patch literal 992 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%b@U_I1CZGssfk$L9 zkoEv$x0Bg+Ai=T%$8;bK*3S@gZ0%tN24+rA7sn8b)2)+pJ?^l|9JjCke@S<4-mba+ zCZe?)?{XD7Dg_;zvsX|ian02@-{yiQ#S;ojI#Vj0<8`Wq&K(fA*8Fx`>X8NaOpB7u zK0n+Qw!>F{%I7=J&J~yc+Q0k%cJbN9H@ofL*Zp~L`1{fC*&aguf`<+~_&>2FQ9>e` zl|M3$XOoHP$>so#o1QX~GgEfYQ_X*WPyIwaV6?A@9ha--W41^iVc-v1X#_v2G_?`JeHx9>myJo#?d=IrNupTfdB z{{CcN_t@8BQ#td5ESpm$kDJ8P^Y~QP%O|S}J^YeszVN8P(W6IG($hcx-l`D3{(oDt z>Y48H>6M?~3X6z}HmS5upJsCJ^|Uuj*6dh%?3miuuU|E#dQWZ3Z9SYQo1Zh~^3Lc~ z_ES^0**dqjwicC_Yl}X3cjms$i94NBJuZE}DCy9Vr6ADG2QE`v#l*P^2p=D8aw&Ca`Vhg ze`7PVW5ImvsqFKP-@V#7bN>AQ5BsOjKmXa8FQ_8HBpML+Hw4|?(kMY#$)8UnsJFBXy zR6MuqSDDs+{NvoH^4H30RaY0+)VKH7f4<+J(d?nJ=-02R(9qD8d-ul1*IKXH+FIFL zR=eP8K}E2FXYuCEyFT4i@AB(;yMgKI%Czc6;>BhhuqFUk_QIcGgnpl#mn*t;lj0_AcbPbJkjSWK# v%&km~txODc4J@n-3>YUYxCzsco1c=IR!KlZoZ_{&Kn)C@u6{1-oD!M<@SeXR literal 0 HcmV?d00001 diff --git a/src/calibre/web/feeds/recipes/__init__.py b/src/calibre/web/feeds/recipes/__init__.py index 019e6a2c97..08f5beed5e 100644 --- a/src/calibre/web/feeds/recipes/__init__.py +++ b/src/calibre/web/feeds/recipes/__init__.py @@ -19,7 +19,8 @@ recipe_modules = [ 'clarin', 'financial_times', 'heise', 'le_monde', 'harpers', 'science_aas', 'science_news', 'the_nation', 'lrb', 'harpers_full', 'liberation', 'linux_magazine', 'telegraph_uk', 'utne', 'sciencedaily', 'forbes', - 'time_magazine', 'endgadget', 'fudzilla', + 'time_magazine', 'endgadget', 'fudzilla', 'nspm_int', 'nspm', 'pescanik', + 'spiegel_int', 'themarketticker', 'tomshardware', ] import re, imp, inspect, time, os diff --git a/src/calibre/web/feeds/recipes/b92.py b/src/calibre/web/feeds/recipes/b92.py index c1874946ad..47d264af1c 100644 --- a/src/calibre/web/feeds/recipes/b92.py +++ b/src/calibre/web/feeds/recipes/b92.py @@ -5,6 +5,7 @@ __copyright__ = '2008, Darko Miletic ' ''' b92.net ''' + import string,re from calibre.web.feeds.news import BasicNewsRecipe @@ -16,25 +17,29 @@ class B92(BasicNewsRecipe): max_articles_per_feed = 100 no_stylesheets = True use_embedded_content = False - + cover_url = 'http://static.b92.net/images/fp/logo.gif' + keep_only_tags = [ dict(name='div', attrs={'class':'sama_vest'}) ] + html2lrf_options = [ + '--comment', description + , '--base-font-size', '10' + , '--category', 'news, Serbia' + , '--publisher', 'B92' + ] preprocess_regexps = [(re.compile(u'\u0110'), lambda match: u'\u00D0')] - - remove_tags_after = dict(name='div', attrs={'class':'gas'}) - remove_tags = [ - dict(name='div' , attrs={'class':'interaction clearfix' }) - ,dict(name='div' , attrs={'class':'gas' }) - ,dict(name='ul' , attrs={'class':'comment-nav' }) - ,dict(name='table', attrs={'class':'pages-navigation-form'}) - ] - feeds = [ - (u'Vesti' , u'http://www.b92.net/info/rss/vesti.xml' ) - ,(u'Kultura' , u'http://www.b92.net/info/rss/kultura.xml' ) - ,(u'Automobili', u'http://www.b92.net/info/rss/automobili.xml') - ,(u'Zivot' , u'http://www.b92.net/info/rss/zivot.xml' ) - ,(u'Tehnopolis', u'http://www.b92.net/info/rss/tehnopolis.xml') - ,(u'Biz' , u'http://www.b92.net/info/rss/biz.xml' ) + (u'Vesti', u'http://www.b92.net/info/rss/vesti.xml') + ,(u'Biz' , u'http://www.b92.net/info/rss/biz.xml' ) + ,(u'Zivot', u'http://www.b92.net/info/rss/zivot.xml') + ,(u'Sport', u'http://www.b92.net/info/rss/sport.xml') ] def print_version(self, url): - return url + '&version=print' + main, sep, article_id = url.partition('nav_id=') + rmain, rsep, rrest = main.partition('.php?') + mrmain , rsepp, nnt = rmain.rpartition('/') + mprmain, rrsep, news_type = mrmain.rpartition('/') + nurl = 'http://www.b92.net/mobilni/' + news_type + '/index.php?nav_id=' + article_id + brbiz, biz, bizrest = rmain.partition('/biz/') + if biz: + nurl = 'http://www.b92.net/mobilni/biz/index.php?nav_id=' + article_id + return nurl diff --git a/src/calibre/web/feeds/recipes/blic.py b/src/calibre/web/feeds/recipes/blic.py index 9d89992eb2..bee95b8424 100644 --- a/src/calibre/web/feeds/recipes/blic.py +++ b/src/calibre/web/feeds/recipes/blic.py @@ -11,12 +11,18 @@ from calibre.web.feeds.news import BasicNewsRecipe class Blic(BasicNewsRecipe): title = u'Blic' __author__ = 'Darko Miletic' - description = 'Vesti' + description = 'Blic.rs online verzija najtiraznije novine u Srbiji donosi najnovije vesti iz Srbije i sveta, komentare, politicke analize, poslovne i ekonomske vesti, vesti iz regiona, intervjue, informacije iz kulture, reportaze, pokriva sve sportske dogadjaje, detaljan tv program, nagradne igre, zabavu, fenomenalni Blic strip, dnevni horoskop, arhivu svih dogadjaja' oldest_article = 7 max_articles_per_feed = 100 no_stylesheets = True use_embedded_content = False - timefmt = ' [%A, %d %B, %Y]' + cover_url = 'http://www.blic.rs/resources/images/header_back_tile.png' + html2lrf_options = [ + '--comment', description + , '--base-font-size', '10' + , '--category', 'news, Serbia' + , '--publisher', 'Blic' + ] preprocess_regexps = [(re.compile(u'\u0110'), lambda match: u'\u00D0')] diff --git a/src/calibre/web/feeds/recipes/clarin.py b/src/calibre/web/feeds/recipes/clarin.py index e4f3c4b501..7dda99a08d 100644 --- a/src/calibre/web/feeds/recipes/clarin.py +++ b/src/calibre/web/feeds/recipes/clarin.py @@ -9,14 +9,19 @@ clarin.com from calibre.web.feeds.news import BasicNewsRecipe class Clarin(BasicNewsRecipe): - title = u'Clarin' + title = 'Clarin' __author__ = 'Darko Miletic' description = 'Noticias de Argentina y mundo' oldest_article = 2 max_articles_per_feed = 100 use_embedded_content = False - simultaneous_downloads = 1 - delay = 1 + cover_url = 'http://www.clarin.com/shared/v10/img/Hd/lg_Clarin.gif' + html2lrf_options = [ + '--comment', description + , '--base-font-size', '10' + , '--category', 'news, Argentina' + , '--publisher', 'Grupo Clarin' + ] remove_tags = [ dict(name='a' , attrs={'class':'Imp' }) diff --git a/src/calibre/web/feeds/recipes/danas.py b/src/calibre/web/feeds/recipes/danas.py index 554945c7b5..54f75b8ad2 100644 --- a/src/calibre/web/feeds/recipes/danas.py +++ b/src/calibre/web/feeds/recipes/danas.py @@ -9,26 +9,33 @@ import string,re from calibre.web.feeds.news import BasicNewsRecipe class Danas(BasicNewsRecipe): - title = u'Danas' + title = 'Danas' __author__ = 'Darko Miletic' - description = 'Vesti' - oldest_article = 7 + description = 'Dnevne novine sa vestima iz sveta, politike, ekonomije, kulture, sporta, Beograda, Novog Sada i cele Srbije.' + oldest_article = 2 max_articles_per_feed = 100 no_stylesheets = True use_embedded_content = False - timefmt = ' [%A, %d %B, %Y]' + cover_url = 'http://www.danas.rs/images/basic/danas.gif' + html2lrf_options = [ + '--comment', description + , '--base-font-size', '10' + , '--category', 'news, Serbia' + , '--publisher', 'Danas' + ] preprocess_regexps = [(re.compile(u'\u0110'), lambda match: u'\u00D0')] keep_only_tags = [ dict(name='div', attrs={'id':'left'}) ] - remove_tags_after = dict(name='div', attrs={'id':'comments'}) remove_tags = [ - dict(name='div', attrs={'class':'width_1_4'}) - ,dict(name='div', attrs={'class':'metaClanka'}) - ,dict(name='div', attrs={'id':'comments'}) - ,dict(name='div', attrs={'class':'baner'}) + dict(name='div', attrs={'class':'width_1_4' }) + ,dict(name='div', attrs={'class':'metaClanka' }) + ,dict(name='div', attrs={'id':'comments' }) + ,dict(name='div', attrs={'class':'baner' }) + ,dict(name='div', attrs={'class':'slikaClanka'}) ] + feeds = [(u'Vesti', u'http://www.danas.rs/rss/rss.asp')] - - feeds = [ (u'Vesti', u'http://www.danas.rs/rss/rss.asp')] + def print_version(self, url): + return url + '&action=print' diff --git a/src/calibre/web/feeds/recipes/jutarnji.py b/src/calibre/web/feeds/recipes/jutarnji.py index b109b2720e..f2504a78c1 100644 --- a/src/calibre/web/feeds/recipes/jutarnji.py +++ b/src/calibre/web/feeds/recipes/jutarnji.py @@ -11,18 +11,30 @@ from calibre.web.feeds.news import BasicNewsRecipe from calibre.ebooks.BeautifulSoup import BeautifulSoup class Jutarnji(BasicNewsRecipe): - title = u'Jutarnji' - __author__ = u'Darko Miletic' - description = u'Hrvatski portal' - oldest_article = 7 + title = 'Jutarnji' + __author__ = 'Darko Miletic' + description = 'Online izdanje Jutarnjeg lista' + oldest_article = 2 max_articles_per_feed = 100 + simultaneous_downloads = 1 + delay = 1 no_stylesheets = True use_embedded_content = False encoding = 'cp1250' - + cover_url = 'http://www.jutarnji.hr/EPHResources/Images/2008/06/05/jhrlogo.png' + html2lrf_options = [ + '--comment', description + , '--base-font-size', '10' + , '--category', 'news, Croatia' + , '--publisher', 'Europapress holding d.o.o.' + ] preprocess_regexps = [(re.compile(u'\u0110'), lambda match: u'\u00D0')] - remove_tags = [dict(name='embed')] + remove_tags = [ + dict(name='embed') + ,dict(name='a', attrs={'class':'a11'}) + ,dict(name='hr') + ] feeds = [ (u'Naslovnica' , u'http://www.jutarnji.hr/rss' ) @@ -37,10 +49,11 @@ class Jutarnji(BasicNewsRecipe): def print_version(self, url): main, split, rest = url.partition('.jl') rmain, rsplit, rrest = main.rpartition(',') - return 'http://www.jutarnji.hr/ispis_clanka.jl?artid=' + rrest + return u'http://www.jutarnji.hr/ispis_clanka.jl?artid=' + rrest def preprocess_html(self, soup): mtag = '' soup.head.insert(0,mtag) + soup.prettify() return soup \ No newline at end of file diff --git a/src/calibre/web/feeds/recipes/lanacion.py b/src/calibre/web/feeds/recipes/lanacion.py index 0dddb05b72..58d7672116 100644 --- a/src/calibre/web/feeds/recipes/lanacion.py +++ b/src/calibre/web/feeds/recipes/lanacion.py @@ -9,13 +9,20 @@ lanacion.com.ar from calibre.web.feeds.news import BasicNewsRecipe class Lanacion(BasicNewsRecipe): - title = u'La Nacion' + title = 'La Nacion' __author__ = 'Darko Miletic' - description = 'Noticias de Argentina y el resto del mundo' - oldest_article = 7 + description = 'Informacion actualizada las 24 horas, con noticias de Argentina y del mundo - Informate ya!' + oldest_article = 2 max_articles_per_feed = 100 no_stylesheets = True use_embedded_content = False + + html2lrf_options = [ + '--comment', description + , '--base-font-size', '10' + , '--category', 'news, Argentina' + , '--publisher', 'La Nacion SA' + ] keep_only_tags = [dict(name='div', attrs={'class':'nota floatFix'})] remove_tags = [ @@ -38,3 +45,12 @@ class Lanacion(BasicNewsRecipe): ,(u'Ciencia/Salud' , u'http://www.lanacion.com.ar/herramientas/rss/index.asp?categoria_id=498' ) ,(u'Revista' , u'http://www.lanacion.com.ar/herramientas/rss/index.asp?categoria_id=494' ) ] + + def get_cover_url(self): + index = 'http://www.lanacion.com.ar' + cover_url = None + soup = self.index_to_soup(index) + cover_item = soup.find('img',attrs={'class':'logo'}) + if cover_item: + cover_url = index + cover_item['src'] + return cover_url diff --git a/src/calibre/web/feeds/recipes/novosti.py b/src/calibre/web/feeds/recipes/novosti.py index 25dd754e34..4ff225fd0a 100644 --- a/src/calibre/web/feeds/recipes/novosti.py +++ b/src/calibre/web/feeds/recipes/novosti.py @@ -9,14 +9,19 @@ import string,re from calibre.web.feeds.news import BasicNewsRecipe class Novosti(BasicNewsRecipe): - title = u'Vecernje Novosti' - __author__ = u'Darko Miletic' - description = u'Vesti' - oldest_article = 7 + title = 'Vecernje Novosti' + __author__ = 'Darko Miletic' + description = 'novosti, vesti, politika, dosije, drustvo, ekonomija, hronika, reportaze, svet, kultura, sport, beograd, regioni, mozaik, feljton, intrvju, pjer, fudbal, kosarka, podvig, arhiva, komentari, kolumne, srbija, republika srpska,Vecernje novosti' + oldest_article = 2 max_articles_per_feed = 100 no_stylesheets = True use_embedded_content = False - timefmt = ' [%A, %d %B, %Y]' + html2lrf_options = [ + '--comment', description + , '--base-font-size', '10' + , '--category', 'news, Serbia' + , '--publisher', 'Novosti AD' + ] preprocess_regexps = [(re.compile(u'\u0110'), lambda match: u'\u00D0')] diff --git a/src/calibre/web/feeds/recipes/nspm.py b/src/calibre/web/feeds/recipes/nspm.py index 10257f0bee..b06df23a75 100644 --- a/src/calibre/web/feeds/recipes/nspm.py +++ b/src/calibre/web/feeds/recipes/nspm.py @@ -18,7 +18,13 @@ class Nspm(BasicNewsRecipe): no_stylesheets = True use_embedded_content = False INDEX = 'http://www.nspm.rs/?alphabet=l' - timefmt = ' [%A, %d %B, %Y]' + cover_url = 'http://nspm.rs/templates/jsn_epic_pro/images/logol.jpg' + html2lrf_options = [ + '--comment', description + , '--base-font-size', '10' + , '--category', 'news, politics, Serbia' + , '--publisher', 'IIC NSPM' + ] preprocess_regexps = [(re.compile(u'\u0110'), lambda match: u'\u00D0')] diff --git a/src/calibre/web/feeds/recipes/nspm_int.py b/src/calibre/web/feeds/recipes/nspm_int.py new file mode 100644 index 0000000000..b474a5e2a9 --- /dev/null +++ b/src/calibre/web/feeds/recipes/nspm_int.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = '2008, Darko Miletic ' +''' +nspm.rs/nspm-in-english +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class Nspm_int(BasicNewsRecipe): + title = 'NSPM in English' + __author__ = 'Darko Miletic' + description = 'Magazine dedicated to political theory and sociological research' + oldest_article = 20 + max_articles_per_feed = 100 + no_stylesheets = True + use_embedded_content = False + INDEX = 'http://www.nspm.rs/?alphabet=l' + cover_url = 'http://nspm.rs/templates/jsn_epic_pro/images/logol.jpg' + html2lrf_options = [ + '--comment', description + , '--base-font-size', '10' + , '--category', 'news, politics, Serbia, english' + , '--publisher', 'IIC NSPM' + ] + + def get_browser(self): + br = BasicNewsRecipe.get_browser() + br.open(self.INDEX) + return br + + + keep_only_tags = [dict(name='div', attrs={'id':'jsn-mainbody'})] + remove_tags = [dict(name='div', attrs={'id':'yvComment' })] + + feeds = [ (u'NSPM in English', u'http://nspm.rs/nspm-in-english/feed/rss.html')] diff --git a/src/calibre/web/feeds/recipes/pescanik.py b/src/calibre/web/feeds/recipes/pescanik.py new file mode 100644 index 0000000000..04d7d88803 --- /dev/null +++ b/src/calibre/web/feeds/recipes/pescanik.py @@ -0,0 +1,35 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = '2008, Darko Miletic ' +''' +pescanik.net +''' + +import string,re +from calibre.web.feeds.news import BasicNewsRecipe + +class Pescanik(BasicNewsRecipe): + title = 'Pescanik' + __author__ = 'Darko Miletic' + description = 'Pescanik' + oldest_article = 7 + max_articles_per_feed = 100 + no_stylesheets = True + use_embedded_content = False + html2lrf_options = ['--base-font-size', '10'] + html2epub_options = 'base_font_size = "10pt"' + + cover_url = "http://pescanik.net/templates/ja_teline/images/logo.png" + + preprocess_regexps = [(re.compile(u'\u0110'), lambda match: u'\u00D0')] + + remove_tags_after = dict(name='div', attrs={'class':'article_seperator'}) + + remove_tags = [dict(name='td' , attrs={'class':'buttonheading'})] + + feeds = [(u'Pescanik Online', u'http://pescanik.net/index.php?option=com_rd_rss&id=12')] + + def print_version(self, url): + nurl = url.replace('http://pescanik.net/index.php','http://pescanik.net/index2.php') + return nurl + '&pop=1&page=0' diff --git a/src/calibre/web/feeds/recipes/politika.py b/src/calibre/web/feeds/recipes/politika.py index 6ccc388b90..949a9b781d 100644 --- a/src/calibre/web/feeds/recipes/politika.py +++ b/src/calibre/web/feeds/recipes/politika.py @@ -9,25 +9,30 @@ import string,re from calibre.web.feeds.news import BasicNewsRecipe class Politika(BasicNewsRecipe): - title = u'Politika Online' + title = 'Politika Online' __author__ = 'Darko Miletic' description = 'Najstariji dnevni list na Balkanu' - oldest_article = 7 + oldest_article = 2 max_articles_per_feed = 100 no_stylesheets = True extra_css = '.content_center_border {text-align: left;}' use_embedded_content = False - timefmt = ' [%A, %d %B, %Y]' + cover_url = 'http://www.politika.rs:8080/images/politika.gif' + html2lrf_options = [ + '--comment', description + , '--base-font-size', '10' + , '--category', 'news, Serbia' + , '--publisher', 'POLITIKA NOVINE I MAGAZINI d.o.o.' + ] preprocess_regexps = [(re.compile(u'\u0110'), lambda match: u'\u00D0')] - remove_tags_before = dict(name='div', attrs={'class':'content_center_border'}) + keep_only_tags = [ dict(name='div', attrs={'class':'contentcenter'}) ] remove_tags_after = dict(name='div', attrs={'class':'datum_item_details'}) feeds = [ (u'Politika' , u'http://www.politika.rs/rubrike/Politika/index.1.lt.xml' ) ,(u'Svet' , u'http://www.politika.rs/rubrike/Svet/index.1.lt.xml' ) - ,(u'Redakcijski komentari', u'http://www.politika.rs/rubrike/redakcijski-komentari/index.1.lt.xml') ,(u'Pogledi' , u'http://www.politika.rs/pogledi/index.lt.xml' ) ,(u'Pogledi sa strane' , u'http://www.politika.rs/rubrike/Pogledi-sa-strane/index.1.lt.xml' ) ,(u'Tema dana' , u'http://www.politika.rs/rubrike/tema-dana/index.1.lt.xml' ) diff --git a/src/calibre/web/feeds/recipes/spiegel_int.py b/src/calibre/web/feeds/recipes/spiegel_int.py new file mode 100644 index 0000000000..7ee8a9f258 --- /dev/null +++ b/src/calibre/web/feeds/recipes/spiegel_int.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = '2008, Darko Miletic ' +''' +spiegel.de +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class Spiegel_int(BasicNewsRecipe): + title = u'Spiegel Online International' + __author__ = 'Darko Miletic' + description = "News and POV from Europe's largest newsmagazine" + oldest_article = 7 + max_articles_per_feed = 100 + no_stylesheets = True + use_embedded_content = False + cover_url = 'http://www.spiegel.de/static/sys/v8/headlines/spiegelonline.gif' + html2lrf_options = [ + '--comment', description + , '--base-font-size', '10' + , '--category', 'news, politics, Germany' + , '--publisher', 'SPIEGEL ONLINE GmbH' + ] + + remove_tags_after = dict(name='div', attrs={'id':'spArticleBody'}) + + feeds = [(u'Spiegel Online', u'http://www.spiegel.de/schlagzeilen/rss/0,5291,676,00.xml')] + + def print_version(self, url): + main, sep, rest = url.rpartition(',') + rmain, rsep, rrest = main.rpartition(',') + return rmain + ',druck-' + rrest + ',' + rest diff --git a/src/calibre/web/feeds/recipes/themarketticker.py b/src/calibre/web/feeds/recipes/themarketticker.py new file mode 100644 index 0000000000..946369c8a9 --- /dev/null +++ b/src/calibre/web/feeds/recipes/themarketticker.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = '2008, Darko Miletic ' +''' +market-ticker.denninger.net +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class Themarketticker(BasicNewsRecipe): + title = 'The Market Ticker' + __author__ = 'Darko Miletic' + description = 'Commentary On The Capital Markets' + oldest_article = 7 + max_articles_per_feed = 100 + no_stylesheets = True + use_embedded_content = True + html2lrf_options = [ '--comment' , description + , '--category' , 'blog,news,finances' + , '--base-font-size', '10' + ] + feeds = [(u'Posts', u'http://market-ticker.denninger.net/feeds/index.rss2')] diff --git a/src/calibre/web/feeds/recipes/tomshardware.py b/src/calibre/web/feeds/recipes/tomshardware.py new file mode 100644 index 0000000000..657a6911f7 --- /dev/null +++ b/src/calibre/web/feeds/recipes/tomshardware.py @@ -0,0 +1,58 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = '2008, Darko Miletic ' +''' +tomshardware.com +''' + +from calibre.ebooks.BeautifulSoup import BeautifulSoup +from calibre.web.feeds.recipes import BasicNewsRecipe + +class Tomshardware(BasicNewsRecipe): + + title = "Tom's Hardware US" + __author__ = 'Darko Miletic' + description = 'Hardware reviews and News' + no_stylesheets = True + needs_subscription = True + INDEX = 'http://www.tomshardware.com' + LOGIN = 'http://www.tomshardware.com/membres/?r=%2Fus%2F#loginForm' + cover_url = 'http://img.bestofmedia.com/img/tomshardware/design/tomshardware.jpg' + + html2lrf_options = [ '--comment' , description + , '--category' , 'hardware,news' + , '--base-font-size', '10' + ] + + def get_browser(self): + br = BasicNewsRecipe.get_browser() + if self.username is not None and self.password is not None: + br.open(self.LOGIN) + br.select_form(name='connexion') + br['login'] = self.username + br['mdp' ] = self.password + br.submit() + return br + + remove_tags = [ + dict(name='div' , attrs={'id':'header' }) + ,dict(name='object') + ] + + feeds = [ + (u'Latest Articles', u'http://www.tomshardware.com/feeds/atom/tom-s-hardware-us,18-2.xml') + ,(u'Latest News' , u'http://www.tomshardware.com/feeds/atom/tom-s-hardware-us,18-1.xml') + ] + + def print_version(self, url): + main, sep, rest = url.rpartition('.html') + rmain, rsep, article_id = main.rpartition(',') + tmain, tsep, trest = rmain.rpartition('/reviews/') + if tsep: + return 'http://www.tomshardware.com/review_print.php?p1=' + article_id + return 'http://www.tomshardware.com/news_print.php?p1=' + article_id + + def preprocess_html(self, soup): + del(soup.body['onload']) + return soup diff --git a/src/calibre/web/feeds/recipes/vreme.py b/src/calibre/web/feeds/recipes/vreme.py index cf0b8cddca..daee3ba3f7 100644 --- a/src/calibre/web/feeds/recipes/vreme.py +++ b/src/calibre/web/feeds/recipes/vreme.py @@ -15,13 +15,16 @@ class Vreme(BasicNewsRecipe): title = 'Vreme' __author__ = 'Darko Miletic' description = 'Politicki Nedeljnik Srbije' - timefmt = ' [%A, %d %B, %Y]' no_stylesheets = True - simultaneous_downloads = 1 - delay = 1 - needs_subscription = True + needs_subscription = True INDEX = 'http://www.vreme.com' LOGIN = 'http://www.vreme.com/account/index.php' + html2lrf_options = [ + '--comment', description + , '--base-font-size', '10' + , '--category', 'news, politics, Serbia' + , '--publisher', 'Vreme d.o.o.' + ] preprocess_regexps = [(re.compile(u'\u0110'), lambda match: u'\u00D0')] @@ -66,3 +69,11 @@ class Vreme(BasicNewsRecipe): def print_version(self, url): return url + '&print=yes' + + def get_cover_url(self): + cover_url = None + soup = self.index_to_soup(self.INDEX) + cover_item = soup.find('img',attrs={'alt':'Naslovna strana broja'}) + if cover_item: + cover_url = self.INDEX + cover_item['src'] + return cover_url