From e558634fb7ce4fe65b53bc122c5ab63685480090 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 19 May 2010 07:28:16 -0600 Subject: [PATCH] EMG by Darko Miletic. Fixes #5569 (New recipes for emg portal in Serbian and English) --- resources/images/news/emg_en.png | Bin 0 -> 682 bytes resources/images/news/emg_rs.recipe | Bin 0 -> 682 bytes resources/recipes/emg_en.recipe | 45 ++++++++++++++++++++++++ resources/recipes/emg_rs.recipe | 51 ++++++++++++++++++++++++++++ 4 files changed, 96 insertions(+) create mode 100644 resources/images/news/emg_en.png create mode 100644 resources/images/news/emg_rs.recipe create mode 100644 resources/recipes/emg_en.recipe create mode 100644 resources/recipes/emg_rs.recipe diff --git a/resources/images/news/emg_en.png b/resources/images/news/emg_en.png new file mode 100644 index 0000000000000000000000000000000000000000..74930f2b646cb9e8faec6a18bec0ab771ef51530 GIT binary patch literal 682 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^mx;TbdoIW~vZ+3{I$kF=pXKQzND+*1} z@Sc^>A)le*cqytYAyGLjs-smbjO`D%k7Aq46b>=2ZDL7^j%yw{`6OL9r`XfD*u&+k}%kD07uw&9MO9J9-AwKPNHGi#b($)ve)Fuu2) zRG|0t)Va@h-XsdD{GR%~PWHilmb7V1GbE$Ur|+z(nDG9r**Qz4_ZAnnx26eM>?@ac zzP;PPIO}fexxQ}~!@N$-JGskly_u?~`g@z{DsN}3$j(WNyct#X-?+ct^s$ZHytpaW zyLL~%x6UZpc>Rm_D?jC~J$h(n;JbZ4m<}9xBD4JcUX}-U{-*NXt2y>#@zlPK$D8wa zR%A?&_O}bttXw8;|A1$g_R^5{L;tlW9zXNpT#@dg+sD5#8kDA}U!8Qk!RyJ64 z@-{N3wOzdFKK+&U9Eo*>Sxb&Rm|9u2N-$p9@NC(wPB)nwB1=DJX&*e3aU_>vl7hsp zUlGici+37uzpu-9@@tZcrr)heOQQYlHT{~RJOln;X?moh;n#G|zC!nQeQsQ3CaZtS z-f3ITF}v!w2y}Fv{BPv7?fjWgm5=v?*B)hjzq#9fDof(E#BCGK&MweftHu83{pBCh zmr5VYTr4;aN;9e@t`Q|Ei6yC4$wjF^iowXh&_LI~RM*fl#K7Fj$kfWjNY}v3%D}+( q{{eLr4Y~O#nQ4_M8Z500O|1;gAQ~ofTEqf1FnGH9xvX^) literal 0 HcmV?d00001 diff --git a/resources/images/news/emg_rs.recipe b/resources/images/news/emg_rs.recipe new file mode 100644 index 0000000000000000000000000000000000000000..74930f2b646cb9e8faec6a18bec0ab771ef51530 GIT binary patch literal 682 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^mx;TbdoIW~vZ+3{I$kF=pXKQzND+*1} z@Sc^>A)le*cqytYAyGLjs-smbjO`D%k7Aq46b>=2ZDL7^j%yw{`6OL9r`XfD*u&+k}%kD07uw&9MO9J9-AwKPNHGi#b($)ve)Fuu2) zRG|0t)Va@h-XsdD{GR%~PWHilmb7V1GbE$Ur|+z(nDG9r**Qz4_ZAnnx26eM>?@ac zzP;PPIO}fexxQ}~!@N$-JGskly_u?~`g@z{DsN}3$j(WNyct#X-?+ct^s$ZHytpaW zyLL~%x6UZpc>Rm_D?jC~J$h(n;JbZ4m<}9xBD4JcUX}-U{-*NXt2y>#@zlPK$D8wa zR%A?&_O}bttXw8;|A1$g_R^5{L;tlW9zXNpT#@dg+sD5#8kDA}U!8Qk!RyJ64 z@-{N3wOzdFKK+&U9Eo*>Sxb&Rm|9u2N-$p9@NC(wPB)nwB1=DJX&*e3aU_>vl7hsp zUlGici+37uzpu-9@@tZcrr)heOQQYlHT{~RJOln;X?moh;n#G|zC!nQeQsQ3CaZtS z-f3ITF}v!w2y}Fv{BPv7?fjWgm5=v?*B)hjzq#9fDof(E#BCGK&MweftHu83{pBCh zmr5VYTr4;aN;9e@t`Q|Ei6yC4$wjF^iowXh&_LI~RM*fl#K7Fj$kfWjNY}v3%D}+( q{{eLr4Y~O#nQ4_M8Z500O|1;gAQ~ofTEqf1FnGH9xvX^) literal 0 HcmV?d00001 diff --git a/resources/recipes/emg_en.recipe b/resources/recipes/emg_en.recipe new file mode 100644 index 0000000000..fc76dc2c97 --- /dev/null +++ b/resources/recipes/emg_en.recipe @@ -0,0 +1,45 @@ +__license__ = 'GPL v3' +__copyright__ = '2010, Darko Miletic ' +''' +emg.rs/en/news +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class emportal_en(BasicNewsRecipe): + title = 'Ekonom:east News' + __author__ = 'Darko Miletic' + description = 'Daily business news from Serbia.' + publisher = 'Ekonom:east Media Group' + category = 'Business, SEE, Serbia, Belgrade, news, Ekonomist, EMportal' + oldest_article = 2 + max_articles_per_feed = 200 + no_stylesheets = True + encoding = 'utf8' + use_embedded_content = False + language = 'en' + remove_empty_feeds = True + masthead_url = 'http://www.emg.rs/img/emportal-rss.png' + extra_css = ' body{font-family: Arial,Helvetica,sans-serif } ' + + conversion_options = { + 'comment' : description + , 'tags' : category + , 'publisher' : publisher + , 'language' : language + } + + remove_tags = [dict(attrs={'class':['text-share']})] + keep_only_tags = [dict(attrs={'class':'text'})] + remove_tags_after = dict(attrs={'class':'text-share'}) + remove_attributes = ['width','height'] + + feeds = [(u'Serbia' , u'http://www.emg.rs/en/news/serbia/rss.xml')] + + def print_version(self, url): + return url.replace('.html','.print.html') + + def preprocess_html(self, soup): + for item in soup.findAll(style=True): + del item['style'] + return soup diff --git a/resources/recipes/emg_rs.recipe b/resources/recipes/emg_rs.recipe new file mode 100644 index 0000000000..7dfc0769ce --- /dev/null +++ b/resources/recipes/emg_rs.recipe @@ -0,0 +1,51 @@ +__license__ = 'GPL v3' +__copyright__ = '2010, Darko Miletic ' +''' +emg.rs/vesti +''' + +import re +from calibre.web.feeds.news import BasicNewsRecipe + +class emportal_rs(BasicNewsRecipe): + title = 'Ekonom:east Vesti' + __author__ = 'Darko Miletic' + description = 'Vasa dnevna doza poslovnih informacija iz Srbije, regiona i sveta. Vesti, Berze, Dogadaji, Casopisi.' + publisher = 'Ekonom:east Media Group' + category = 'Ekonom:east Media Group, Ekonomist, Budelar, Bankar, EMportal, Preduzeca, Moja Posla, EU praktikum, ekonomija, Srbija, Beograd, investicije, finansije, energetika, berza' + oldest_article = 2 + max_articles_per_feed = 200 + no_stylesheets = True + encoding = 'utf8' + use_embedded_content = False + language = 'sr' + remove_empty_feeds = True + masthead_url = 'http://www.emg.rs/img/emportal-rss.png' + extra_css = ' @font-face {font-family: "sans1";src:url(res:///opt/sony/ebook/FONT/tt0003m_.ttf)} body{font-family: Arial,Helvetica,sans1,sans-serif } .article_description{font-family: sans1, sans-serif} ' + + conversion_options = { + 'comment' : description + , 'tags' : category + , 'publisher' : publisher + , 'language' : language + } + + preprocess_regexps = [(re.compile(u'\u0110'), lambda match: u'\u00D0')] + remove_tags = [dict(attrs={'class':['text-share']})] + keep_only_tags = [dict(attrs={'class':'text'})] + remove_tags_after = dict(attrs={'class':'text-share'}) + remove_attributes = ['width','height'] + + feeds = [ + (u'Srbija' , u'http://www.emg.rs/vesti/srbija/rss.xml') + ,(u'Region' , u'http://www.emg.rs/vesti/region/rss.xml') + ,(u'Svet' , u'http://www.emg.rs/vesti/svet/rss.xml' ) + ] + + def print_version(self, url): + return url.replace('.html','.print.html') + + def preprocess_html(self, soup): + for item in soup.findAll(style=True): + del item['style'] + return soup