From b4cd8ab9c975d7a6a5bcd30c65d47afb15d00dd3 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 4 Aug 2010 08:28:57 -0600 Subject: [PATCH] Fix #6403 (New recipe for BalkanInsight newsportal) --- resources/images/news/balkaninsight.png | Bin 0 -> 573 bytes resources/recipes/balkaninsight.recipe | 62 ++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 resources/images/news/balkaninsight.png create mode 100644 resources/recipes/balkaninsight.recipe diff --git a/resources/images/news/balkaninsight.png b/resources/images/news/balkaninsight.png new file mode 100644 index 0000000000000000000000000000000000000000..f2d5b35deeba1758cf4b118d885b0ad5d5fcb64f GIT binary patch literal 573 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b zK-vS0-A-oPfdtD69Mgd`SU*F|v9*U87#Pz$T^vI!PG6n8*V`#jqJ92q^UeB8JSM$i z-Xi3vr1Wb-+qJ9}sY1%#F@5u79z1>9{3Cl6hd{lr;pRO@=Us1B@lG+y44s_fDV=!maaij^J8AXR zmv_X5F$87KeBdk7zSfvu_d(9iFxwUt(O8x0+!subNiR)E6aH45yA5 zo#J(S%l9c+T_90iAn^0jn~GAeS9_N`UU_X0I(7BWZx5H=^7U-E$Y|}Z9o)majd?@0 zOzLZeKgJ6_wDkT}aBDWZ8`^mEXMZ@$hjl-%w))0*_{MWMUf{Bt^}6F;>&djI`rO7X z>(6i4ZdEKBb4RT!Dp`ZTjjZsY0ye}TcT zTH+c}l9E`GYL#4+3Zxi}3=9o)4J>pGOhODStc=X9j7@Y6%&ZIy&aHT$iJ~DlKP5A* g5?O|W}pTJPgg&ebxsLQ07Ojbb^rhX literal 0 HcmV?d00001 diff --git a/resources/recipes/balkaninsight.recipe b/resources/recipes/balkaninsight.recipe new file mode 100644 index 0000000000..9d7396a9aa --- /dev/null +++ b/resources/recipes/balkaninsight.recipe @@ -0,0 +1,62 @@ +__license__ = 'GPL v3' +__copyright__ = '2010, Darko Miletic ' +''' +balkaninsight.com +''' + +import re +from calibre.web.feeds.news import BasicNewsRecipe + +class BalkanInsight(BasicNewsRecipe): + title = 'Balkan Insight' + __author__ = 'Darko Miletic' + description = 'Get exclusive news and in depth information on business, politics, events and lifestyle in the Balkans. Free and exclusive premium content.' + publisher = 'BalkanInsight.com' + category = 'news, politics, Balcans' + oldest_article = 2 + max_articles_per_feed = 100 + no_stylesheets = False + use_embedded_content = False + encoding = 'utf-8' + masthead_url = 'http://www.balkaninsight.com/templates/balkaninsight/images/aindex_02.jpg' + language = 'en' + publication_type = 'newsportal' + remove_empty_feeds = True + extra_css = """ @font-face {font-family: "serif1";src:url(res:///opt/sony/ebook/FONT/tt0011m_.ttf)} + @font-face {font-family: "sans1";src:url(res:///opt/sony/ebook/FONT/tt0003m_.ttf)} + .article_description,body{font-family: Arial,Verdana,Helvetica,sans1,sans-serif} + img{margin-bottom: 0.8em} + h1,h2,h3,h4{font-family: Times,Georgia,serif1,serif; color: #24569E} + .article-deck {color:#777777; font-size: small;} + .main_news_img{font-size: small} """ + + conversion_options = { + 'comment' : description + , 'tags' : category + , 'publisher' : publisher + , 'language' : language + } + + preprocess_regexps = [(re.compile(u'\u0110'), lambda match: u'\u00D0')] + + keep_only_tags = [dict(name='div', attrs={'id':'article'})] + remove_tags = [ + dict(name=['object','link','iframe']) + ] + + feeds = [ + (u'Albania' , u'http://www.balkaninsight.com/?tpl=653&tpid=144' ) + ,(u'Bosnia' , u'http://www.balkaninsight.com/?tpl=653&tpid=145' ) + ,(u'Bulgaria' , u'http://www.balkaninsight.com/?tpl=653&tpid=146' ) + ,(u'Croatia' , u'http://www.balkaninsight.com/?tpl=653&tpid=147' ) + ,(u'Kosovo' , u'http://www.balkaninsight.com/?tpl=653&tpid=148' ) + ,(u'Macedonia' , u'http://www.balkaninsight.com/?tpl=653&tpid=149' ) + ,(u'Montenegro' , u'http://www.balkaninsight.com/?tpl=653&tpid=150' ) + ,(u'Romania' , u'http://www.balkaninsight.com/?tpl=653&tpid=151' ) + ,(u'Serbia' , u'http://www.balkaninsight.com/?tpl=653&tpid=152' ) + ] + + def preprocess_html(self, soup): + for item in soup.findAll(style=True): + del item['style'] + return self.adeify_images(soup)