From ea3939fea6e528088387d489ca46e60819d5beef Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 26 Apr 2010 08:55:13 -0600 Subject: [PATCH] China Daily by Darko Miletic --- resources/images/news/chinadaily.png | Bin 0 -> 491 bytes resources/recipes/chinadaily.recipe | 48 +++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 resources/images/news/chinadaily.png create mode 100644 resources/recipes/chinadaily.recipe diff --git a/resources/images/news/chinadaily.png b/resources/images/news/chinadaily.png new file mode 100644 index 0000000000000000000000000000000000000000..1744906052ff8b04fa4709828ef26ac8f912106f GIT binary patch literal 491 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbMffdHQn*XrGO=bwFUG2=|Yl1nkG zukO12R%616l=av3C!Z2&JsjV-K%n^$NBsf+C70^=-pk)|Yxe19@4x>p-hNxS_3-aA zE2f-y!ccvPq3W>nyz||MABHTuEYN)H{=4trfB&6!@`=NobBaC3&OiH{zTw8@7hf2v z4_`XC%VgU5rhWGrs`vf>{~zcI3PD7W?J1xUoCO|{#X#BvjNMLV+kphj3LMjcG}z}1 zF~`;(26Cc2T^vIsF0Vaj&ez}|;CwN%=$vKxp6~k=)-Z4ee%5*&uJ+Hdo|UsJn&+5s zh{Dt(ebIu?WVvKkDC<{lYMZ0*_=@xPjgggW?>^j=lID8wNXLx(E=Nwh{&4^DcIL!4 zD%uUZAFBXuQ7v(eC`m~yNwrEYN(E93Mh1okx&|h?MrI)f7FH$}R>r2f24+?U28T@U pPe9R-o1c=IR*9^^(9p`**viBRqG7vNXdqAngQu&X%Q~loCIE{4tjqua literal 0 HcmV?d00001 diff --git a/resources/recipes/chinadaily.recipe b/resources/recipes/chinadaily.recipe new file mode 100644 index 0000000000..09c054008d --- /dev/null +++ b/resources/recipes/chinadaily.recipe @@ -0,0 +1,48 @@ +__license__ = 'GPL v3' +__copyright__ = '2010, Darko Miletic ' +''' +www.chinadaily.com.cn +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class Pagina12(BasicNewsRecipe): + title = 'China Daily' + __author__ = 'Darko Miletic' + description = 'Chinadaily.com.cn is the largest English portal in China, providing news, business information, BBS, learning materials.' + publisher = 'China Daily Information Co.' + category = 'news, politics, China' + oldest_article = 2 + max_articles_per_feed = 200 + no_stylesheets = True + encoding = 'utf8' + use_embedded_content = False + language = 'en_CN' + remove_empty_feeds = True + publication_type = 'newsportal' + masthead_url = 'http://www.chinadaily.com.cn/15421.files/chinadailylogo_e_20100301.jpg' + extra_css = ' body{font-family: Arial,Helvetica,sans-serif } ' + + conversion_options = { + 'comment' : description + , 'tags' : category + , 'publisher' : publisher + , 'language' : language + } + + remove_tags = [dict(name=['object','embed','iframe','table'])] + keep_only_tags = [dict(attrs={'id':['Title_e','Content']})] + + + feeds = [ + (u'China' , u'http://www.chinadaily.com.cn/rss/china_rss.xml' ) + ,(u'Business', u'http://www.chinadaily.com.cn/rss/bizchina_rss.xml') + ,(u'World' , u'http://www.chinadaily.com.cn/rss/world_rss.xml' ) + ,(u'Sports' , u'http://www.chinadaily.com.cn/rss/sports_rss.xml' ) + ,(u'Opinions', u'http://www.chinadaily.com.cn/rss/opinion_rss.xml' ) + ] + + def preprocess_html(self, soup): + for item in soup.findAll(style=True): + del item['style'] + return soup