diff --git a/resources/recipes/ajc.recipe b/resources/recipes/ajc.recipe index ea989b4b4c..031fe13170 100644 --- a/resources/recipes/ajc.recipe +++ b/resources/recipes/ajc.recipe @@ -16,6 +16,7 @@ class AdvancedUserRecipe1282101454(BasicNewsRecipe): title = 'The AJC' timefmt = ' [%a,%d %B %Y %I:%M %p]' __author__ = 'TonytheBookworm' + language = 'en' description = 'News from Atlanta and USA' publisher = 'The Atlanta Journal' category = 'news, politics, USA' diff --git a/resources/recipes/china_economic_net.recipe b/resources/recipes/china_economic_net.recipe index 825ea007c2..6fcb2e36ed 100644 --- a/resources/recipes/china_economic_net.recipe +++ b/resources/recipes/china_economic_net.recipe @@ -26,7 +26,7 @@ class AdvancedUserRecipe1278162597(BasicNewsRecipe): remove_javascript = True use_embedded_content = False no_stylesheets = True - language = 'zh-cn' + language = 'zh_CN' encoding = 'gb2312' conversion_options = {'linearize_tables':True} diff --git a/resources/recipes/cinebel_be.recipe b/resources/recipes/cinebel_be.recipe new file mode 100644 index 0000000000..ec76bfc894 --- /dev/null +++ b/resources/recipes/cinebel_be.recipe @@ -0,0 +1,40 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = '2008, Lionel Bergeret ' +''' +cinebel.be +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class Cinebel(BasicNewsRecipe): + title = u'Cinebel' + __author__ = u'Lionel Bergeret' + description = u'Cinema news from Belgium in French' + publisher = u'cinebel.be' + category = 'news, cinema, movie, Belgium' + oldest_article = 3 + encoding = 'utf8' + language = 'fr_BE' + + max_articles_per_feed = 20 + no_stylesheets = True + use_embedded_content = False + timefmt = ' [%d %b %Y]' + + keep_only_tags = [ + dict(name = 'span', attrs = {'class': 'movieMainTitle'}) + ,dict(name = 'div', attrs = {'id': 'filmPoster'}) + ,dict(name = 'div', attrs = {'id': 'filmDefinition'}) + ,dict(name = 'div', attrs = {'id': 'synopsis'}) + ] + + feeds = [ + (u'Les sorties de la semaine' , u'http://www.cinebel.be/Servlets/RssServlet?languageCode=fr&rssType=0' ) + ,(u'Top 10' , u'http://www.cinebel.be/Servlets/RssServlet?languageCode=fr&rssType=2' ) + ] + + def get_cover_url(self): + cover_url = 'http://www.cinebel.be/portal/resources/common/logo_index.gif' + return cover_url diff --git a/resources/recipes/dhnet_be.recipe b/resources/recipes/dhnet_be.recipe index a827ae307f..ef4d1736e3 100644 --- a/resources/recipes/dhnet_be.recipe +++ b/resources/recipes/dhnet_be.recipe @@ -6,6 +6,7 @@ __copyright__ = '2008, Lionel Bergeret ' dhnet.be ''' +from calibre import strftime from calibre.web.feeds.news import BasicNewsRecipe class DHNetBe(BasicNewsRecipe): @@ -15,7 +16,7 @@ class DHNetBe(BasicNewsRecipe): publisher = u'dhnet.be' category = 'news, Belgium' oldest_article = 3 - language = 'fr' + language = 'fr_BE' max_articles_per_feed = 20 no_stylesheets = True @@ -29,6 +30,10 @@ class DHNetBe(BasicNewsRecipe): feeds = [ (u'La Une' , u'http://www.dhnet.be/rss' ) - ,(u'La Une Sports' , u'http://www.dhnet.be/rss/dhsports/' ) - ,(u'La Une Info' , u'http://www.dhnet.be/rss/dhinfos/' ) + ,(u'La Une Sports' , u'http://www.dhnet.be/rss/dhsports/' ) + ,(u'La Une Info' , u'http://www.dhnet.be/rss/dhinfos/' ) ] + + def get_cover_url(self): + cover_url = strftime('http://pdf-online.dhnet.be/pdfonline/image/%Y%m%d/dh_%Y%m%d_nam_infoge_001.pdf.L.jpg') + return cover_url diff --git a/resources/recipes/journalgazette.recipe b/resources/recipes/journalgazette.recipe index 406917f5ce..4f12e92280 100644 --- a/resources/recipes/journalgazette.recipe +++ b/resources/recipes/journalgazette.recipe @@ -11,6 +11,7 @@ class AdvancedUserRecipe1283666183(BasicNewsRecipe): title = u'Journal Gazette Ft. Wayne IN' __author__ = 'cynvision' oldest_article = 1 + language = 'en' max_articles_per_feed = 8 no_stylesheets = True remove_javascript = True diff --git a/resources/recipes/lalibre_be.recipe b/resources/recipes/lalibre_be.recipe new file mode 100644 index 0000000000..53e346bf12 --- /dev/null +++ b/resources/recipes/lalibre_be.recipe @@ -0,0 +1,43 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = '2008, Lionel Bergeret ' +''' +lalibre.be +''' + +from calibre import strftime +from calibre.web.feeds.news import BasicNewsRecipe + +class LaLibre(BasicNewsRecipe): + title = u'La Libre Belgique' + __author__ = u'Lionel Bergeret' + description = u'News from Belgium in French' + publisher = u'lalibre.be' + category = 'news, Belgium' + oldest_article = 3 + language = 'fr_BE' + + max_articles_per_feed = 20 + no_stylesheets = True + use_embedded_content = False + timefmt = ' [%d %b %Y]' + + keep_only_tags = [ + dict(name = 'div', attrs = {'id': 'articleHat'}) + ,dict(name = 'p', attrs = {'id': 'publicationDate'}) + ,dict(name = 'div', attrs = {'id': 'articleText'}) + ] + + feeds = [ + (u'L\'actu' , u'http://www.lalibre.be/rss/?section=10' ) + ,(u'Culture' , u'http://www.lalibre.be/rss/?section=5' ) + ,(u'Economie' , u'http://www.lalibre.be/rss/?section=3' ) + ,(u'Libre Entreprise' , u'http://www.lalibre.be/rss/?section=904' ) + ,(u'Sports' , u'http://www.lalibre.be/rss/?section=2' ) + ,(u'Societe' , u'http://www.lalibre.be/rss/?section=12' ) + ] + + def get_cover_url(self): + cover_url = strftime('http://pdf-online.lalibre.be/pdfonline/image/%Y%m%d/llb_%Y%m%d_nam_libre_001.pdf.L.jpg') + return cover_url diff --git a/resources/recipes/lameuse_be.recipe b/resources/recipes/lameuse_be.recipe new file mode 100644 index 0000000000..03b7f84a5f --- /dev/null +++ b/resources/recipes/lameuse_be.recipe @@ -0,0 +1,54 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = '2008, Lionel Bergeret ' +''' +lameuse.be +''' + +from calibre import strftime +from calibre.web.feeds.news import BasicNewsRecipe + +class LaMeuse(BasicNewsRecipe): + title = u'La Meuse' + __author__ = u'Lionel Bergeret' + description = u'News from Belgium in French' + publisher = u'lameuse.be' + category = 'news, Belgium' + oldest_article = 3 + encoding = 'utf8' + language = 'fr_BE' + + max_articles_per_feed = 20 + no_stylesheets = True + use_embedded_content = False + timefmt = ' [%d %b %Y]' + + keep_only_tags = [ + dict(name = 'div', attrs = {'id': 'article'}) + ] + + remove_tags = [ + dict(name = 'div', attrs = {'class': 'sb-group'}) + ,dict(name = 'div', attrs = {'id': 'share'}) + ,dict(name = 'div', attrs = {'id': 'commentaires'}) + ] + + feeds = [ + (u'Actualite', u'http://www.lameuse.be/services/fils_rss/actualite/index.xml' ) + ,(u'Belgique', u'http://www.lameuse.be/services/fils_rss/actualite/belgique/index.xml' ) + ,(u'Monde', u'http://www.lameuse.be/services/fils_rss/actualite/monde/index.xml' ) + ,(u'Societe', u'http://www.lameuse.be/services/fils_rss/actualite/societe/index.xml' ) + ,(u'Faits Divers', u'http://www.lameuse.be/services/fils_rss/actualite/faits_divers/index.xml' ) + ,(u'Economie', u'http://www.lameuse.be/services/fils_rss/actualite/economie/index.xml' ) + ,(u'Science', u'http://www.lameuse.be/services/fils_rss/actualite/science/index.xml' ) + ,(u'Sante', u'http://www.lameuse.be/services/fils_rss/actualite/sante/index.xml' ) + ,(u'Insolite', u'http://www.lameuse.be/services/fils_rss/magazine/insolite/index.xml' ) + ,(u'Cinema', u'http://www.lameuse.be/services/fils_rss/culture/cinema/index.xml' ) + ,(u'Musique', u'http://www.lameuse.be/services/fils_rss/culture/musique/index.xml' ) + ,(u'Livres', u'http://www.lameuse.be/services/fils_rss/culture/livres/index.xml' ) + ] + + def get_cover_url(self): + cover_url = strftime('http://pdf.lameuse.be/pdf/lameuse_%Y-%m-%d_LIEG_ACTUALITE_1.PDF') + return cover_url diff --git a/resources/recipes/lavenir_be.recipe b/resources/recipes/lavenir_be.recipe new file mode 100644 index 0000000000..68be449ae5 --- /dev/null +++ b/resources/recipes/lavenir_be.recipe @@ -0,0 +1,40 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = '2008, Lionel Bergeret ' +''' +lavenir.net +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class LAvenir(BasicNewsRecipe): + title = u'L\'Avenir' + __author__ = u'Lionel Bergeret' + description = u'News from Belgium in French' + publisher = u'lavenir.net' + category = 'news, Belgium' + oldest_article = 3 + encoding = 'utf8' + language = 'fr_BE' + + max_articles_per_feed = 20 + no_stylesheets = True + use_embedded_content = False + timefmt = ' [%d %b %Y]' + + keep_only_tags = [ + dict(name = 'div', attrs = {'class': 'photo'}) + ,dict(name = 'p', attrs = {'class': 'intro'}) + ,dict(name = 'div', attrs = {'class': 'article-body'}) + ] + + feeds = [ + (u'Belgique' , u'http://www.lavenir.net/rss.aspx?foto=1&intro=1§ion=info&info=df156511-c24f-4f21-81c3-a5d439a9cf4b' ) + ,(u'Monde' , u'http://www.lavenir.net/rss.aspx?foto=1&intro=1§ion=info&info=1642237c-66b9-4e8a-a8c1-288d61fefe7e' ) + ,(u'Societe' , u'http://www.lavenir.net/rss.aspx?foto=1&intro=1§ion=info&info=12e1a2f4-7e03-4cf1-afec-016869072317' ) + ] + + def get_cover_url(self): + cover_url = 'http://www.lavenir.net/extra/Static/journal/Pdf/1/UNE_Nationale.PDF' + return cover_url diff --git a/resources/recipes/lesoir_be.recipe b/resources/recipes/lesoir_be.recipe index 600ef6bc29..6b6891c3b8 100644 --- a/resources/recipes/lesoir_be.recipe +++ b/resources/recipes/lesoir_be.recipe @@ -6,6 +6,7 @@ __copyright__ = '2008, Lionel Bergeret ' lesoir.be ''' +from calibre import strftime from calibre.web.feeds.news import BasicNewsRecipe class LeSoirBe(BasicNewsRecipe): @@ -15,7 +16,7 @@ class LeSoirBe(BasicNewsRecipe): publisher = u'lesoir.be' category = 'news, Belgium' oldest_article = 3 - language = 'fr' + language = 'fr_BE' max_articles_per_feed = 20 no_stylesheets = True @@ -35,9 +36,13 @@ class LeSoirBe(BasicNewsRecipe): feeds = [ (u'Belgique' , u'http://www.lesoir.be/actualite/belgique/rss.xml' ) - ,(u'France' , u'http://www.lesoir.be/actualite/france/rss.xml' ) - ,(u'Monde' , u'http://www.lesoir.be/actualite/monde/rss.xml' ) - ,(u'Regions' , u'http://www.lesoir.be/regions/rss.xml' ) - ,(u'Vie du Net' , u'http://www.lesoir.be/actualite/vie_du_net/rss.xml' ) - ,(u'Petite Gazette' , u'http://www.lesoir.be/actualite/sciences/rss.xml' ) + ,(u'France' , u'http://www.lesoir.be/actualite/france/rss.xml' ) + ,(u'Monde' , u'http://www.lesoir.be/actualite/monde/rss.xml' ) + ,(u'Regions' , u'http://www.lesoir.be/regions/rss.xml' ) + ,(u'Vie du Net' , u'http://www.lesoir.be/actualite/vie_du_net/rss.xml' ) + ,(u'Petite Gazette' , u'http://www.lesoir.be/actualite/sciences/rss.xml' ) ] + + def get_cover_url(self): + cover_url = strftime( 'http://pdf.lesoir.be/pdf/%Y-%m-%d_BRUX_UNE_1.PDF') + return cover_url diff --git a/resources/recipes/onionavclub.recipe b/resources/recipes/onionavclub.recipe index 5bc069b6ed..038111cbe9 100644 --- a/resources/recipes/onionavclub.recipe +++ b/resources/recipes/onionavclub.recipe @@ -12,6 +12,7 @@ class BBC(BasicNewsRecipe): title = u'The Onion AV Club' __author__ = 'Stephen Williams' description = 'Film, Television and Music Reviews' + language = 'en' no_stylesheets = True oldest_article = 2 max_articles_per_feed = 100 diff --git a/resources/recipes/oriental_daily.recipe b/resources/recipes/oriental_daily.recipe new file mode 100644 index 0000000000..e8048edcc5 --- /dev/null +++ b/resources/recipes/oriental_daily.recipe @@ -0,0 +1,50 @@ + +__license__ = 'GPL v3' +__copyright__ = '2010, Larry Chan ' +''' +oriental daily +''' +from calibre.web.feeds.recipes import BasicNewsRecipe + +class OrientalDaily(BasicNewsRecipe): + title = 'Oriental Dailly' + __author__ = 'Larry Chan' + description = 'News from HK' + oldest_article = 2 + max_articles_per_feed = 100 + simultaneous_downloads = 5 + no_stylesheets = True + #delay = 1 + use_embedded_content = False + encoding = 'utf8' + publisher = 'Oriental Daily' + category = 'news, HK, world' + language = 'zh' + publication_type = 'newsportal' + extra_css = ' body{ font-family: Verdana,Helvetica,Arial,sans-serif } .introduction{font-weight: bold} .story-feature{display: block; padding: 0; border: 1px solid; width: 40%; font-size: small} .story-feature h2{text-align: center; text-transform: uppercase} ' + + conversion_options = { + 'comments' : description + ,'tags' : category + ,'language' : language + ,'publisher' : publisher + ,'linearize_tables': True + } + + remove_tags_after = dict(id='bottomNavCTN') + + keep_only_tags = [ + dict(name='div', attrs={'id':['leadin', 'contentCTN-right']}) + + ] + + remove_tags = [ + dict(name='div', attrs={'class':['largeAdsCTN', 'contentCTN-left', 'textAdsCTN', 'footerAds clear']}), + dict(name='div', attrs={'id':['articleNav']}) + + ] + + remove_attributes = ['width','height','href'] + + + feeds = [(u'Oriental Daily', u'http://orientaldaily.on.cc/rss/news.xml')] diff --git a/resources/recipes/technology_review.recipe b/resources/recipes/technology_review.recipe index f001fcf4c1..cc8f13733e 100644 --- a/resources/recipes/technology_review.recipe +++ b/resources/recipes/technology_review.recipe @@ -7,6 +7,7 @@ class TechnologyReview(BasicNewsRecipe): description = 'MIT Technology Magazine' publisher = 'Technology Review Inc.' category = 'Technology, Innovation, R&D' + language = 'en' oldest_article = 14 max_articles_per_feed = 100 No_stylesheets = True diff --git a/src/calibre/utils/localization.py b/src/calibre/utils/localization.py index 94f3923acf..2532962bf6 100644 --- a/src/calibre/utils/localization.py +++ b/src/calibre/utils/localization.py @@ -112,6 +112,7 @@ _extra_lang_codes = { 'en_CN' : _('English (China)'), 'es_PY' : _('Spanish (Paraguay)'), 'de_AT' : _('German (AT)'), + 'fr_BE' : _('French (BE)'), 'nl' : _('Dutch (NL)'), 'nl_BE' : _('Dutch (BE)'), 'und' : _('Unknown')