From 6d80e2093cee088427e2d5fd50099f2fdc0bacb4 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 15 Jun 2010 11:03:19 -0600 Subject: [PATCH] Thai Rath and The Nation (Thailand) by Anat Ruangrassamee --- resources/recipes/thairath.recipe | 58 ++++++++++++++++++++++++ resources/recipes/the_nation_thai.recipe | 44 ++++++++++++++++++ src/calibre/utils/localization.py | 1 + 3 files changed, 103 insertions(+) create mode 100644 resources/recipes/thairath.recipe create mode 100644 resources/recipes/the_nation_thai.recipe diff --git a/resources/recipes/thairath.recipe b/resources/recipes/thairath.recipe new file mode 100644 index 0000000000..6ebb84f3a5 --- /dev/null +++ b/resources/recipes/thairath.recipe @@ -0,0 +1,58 @@ +from calibre.web.feeds.news import BasicNewsRecipe + +class AdvancedUserRecipe1271637235(BasicNewsRecipe): + + title = u'Thairath' + __author__ = 'Anat R.' + language = 'th' + + oldest_article = 7 + + max_articles_per_feed = 100 + no_stylesheets = True + + remove_javascript = True + + use_embedded_content = False + feeds = [(u'News', +u'http://www.thairath.co.th/rss/news.xml'), (u'Politics', +u'http://www.thairath.co.th/rss/pol.xml'), (u'Economy', +u'http://www.thairath.co.th/rss/eco.xml'), (u'International', +u'http://www.thairath.co.th/rss/oversea.xml'), (u'Sports', +u'http://www.thairath.co.th/rss/sport.xml'), (u'Life', +u'http://www.thairath.co.th/rss/life.xml'), (u'Education', +u'http://www.thairath.co.th/rss/edu.xml'), (u'Tech', +u'http://www.thairath.co..th/rss/tech.xml'), (u'Entertainment', +u'http://www.thairath.co.th/rss/ent.xml')] + keep_only_tags = [] + + keep_only_tags.append(dict(name = 'h1', attrs = {'id' : 'title'})) + + keep_only_tags.append(dict(name = 'ul', attrs = {'class' : +'detail-info'})) + + keep_only_tags.append(dict(name = 'img', attrs = {'class' : +'detail-image'})) + + keep_only_tags.append(dict(name = 'div', attrs = {'class' : +'entry'})) + remove_tags = [] + remove_tags.append(dict(name = 'div', attrs = {'id': +'menu-holder'})) + + remove_tags.append(dict(name = 'div', attrs = {'class': +'addthis_toolbox addthis_default_style'})) + + remove_tags.append(dict(name = 'div', attrs = {'class': 'box top-item'})) + + remove_tags.append(dict(name = 'div', attrs = {'class': 'column-200 column-margin-430'})) + + remove_tags.append(dict(name = 'div', attrs = {'id': +'detail-related'})) + + remove_tags.append(dict(name = 'div', attrs = {'id': 'related'})) + + remove_tags.append(dict(name = 'id', attrs = {'class': 'footer'})) + + remove_tags.append(dict(name = "ul",attrs = +{'id':'banner-highlights-images'})) diff --git a/resources/recipes/the_nation_thai.recipe b/resources/recipes/the_nation_thai.recipe new file mode 100644 index 0000000000..a33a16e0a5 --- /dev/null +++ b/resources/recipes/the_nation_thai.recipe @@ -0,0 +1,44 @@ + +from calibre.web.feeds.news import BasicNewsRecipe + +class AdvancedUserRecipe1271596863(BasicNewsRecipe): + + title = u'The Nation' + __author__ = 'Anat R.' + language = 'en_TH' + + oldest_article = 7 + + max_articles_per_feed = 100 + no_stylesheets = True + + remove_javascript = True + + use_embedded_content = False + feeds = [(u'Topstory', +u'http://www.nationmultimedia.com/home/rss/topstories.rss'), +(u'National', u'http://www.nationmultimedia.com/home/rss/national.rss'), + (u'Politics', +u'http://www.nationmultimedia.com/home/rss/politics.rss'), (u'Business', + u'http://www.nationmultimedia.com/home/rss/business.rss'), +(u'Regional', u'http://www.nationmultimedia.com/home/rss/regional.rss'), + (u'Sports', u'http://www.nationmultimedia.com/home/rss/sport.rss'), +(u'Travel', u'http://www.nationmultimedia.com/home/rss/travel.rss'), +(u'Life', u'http://www.nationmultimedia.com/home/rss/life.rss')] + keep_only_tags = [] + + keep_only_tags.append(dict(name = 'div', attrs = {'class' : +'pd10'})) + remove_tags = [] + + remove_tags.append(dict(name = 'div', attrs = {'class': +'WrapperHeaderCol2-2'})) + + remove_tags.append(dict(name = 'div', attrs = {'class': +'LayoutMenu2'})) + + remove_tags.append(dict(name = 'div', attrs = {'class': +'TextHeaderRight'})) + + remove_tags.append(dict(name = "ul",attrs = {'id':'toolZoom'})) + diff --git a/src/calibre/utils/localization.py b/src/calibre/utils/localization.py index 026547ee2e..e60a3233c6 100644 --- a/src/calibre/utils/localization.py +++ b/src/calibre/utils/localization.py @@ -103,6 +103,7 @@ _extra_lang_codes = { 'en_TH' : _('English (Thailand)'), 'en_CY' : _('English (Cyprus)'), 'en_PK' : _('English (Pakistan)'), + 'en_IL' : _('English (Israel)'), 'en_SG' : _('English (Singapore)'), 'en_YE' : _('English (Yemen)'), 'en_IE' : _('English (Ireland)'),