From 2c0de47f90dfdbb9410894bb7255ac9290539d9d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 17 Dec 2009 11:27:56 -0700 Subject: [PATCH] New recipe for boston.com by Darko Miletic --- resources/recipes/boston.com.recipe | 49 +++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 resources/recipes/boston.com.recipe diff --git a/resources/recipes/boston.com.recipe b/resources/recipes/boston.com.recipe new file mode 100644 index 0000000000..125cc4643f --- /dev/null +++ b/resources/recipes/boston.com.recipe @@ -0,0 +1,49 @@ +__license__ = 'GPL v3' +__copyright__ = '2009, Darko Miletic ' +''' +www.boston.com +''' + +from calibre.web.feeds.recipes import BasicNewsRecipe + +class BusinessStandard(BasicNewsRecipe): + title = 'Boston' + __author__ = 'Darko Miletic' + description = 'News from Boston' + oldest_article = 7 + max_articles_per_feed = 100 + no_stylesheets = True + delay = 1 + use_embedded_content = False + encoding = 'cp1252' + publisher = 'Boston' + category = 'news, boston, usa, world' + language = 'en' + + conversion_options = { + 'comments' : description + ,'tags' : category + ,'language' : language + ,'publisher' : publisher + } + + keep_only_tags = [dict(name='div', attrs={'class':'story'})] + remove_tags = [dict(name=['object','link','script','iframe'])] + + feeds = [ + (u'Top Stories' , u'http://feeds.boston.com/boston/topstories' ) + ,(u'Patriots news', u'http://feeds.boston.com/boston/sports/football/patriots') + ,(u'National news', u'http://feeds.boston.com/boston/news/nation' ) + ,(u'World news' , u'http://feeds.boston.com/boston/news/world' ) + ] + + def print_version(self, url): + return url + '?mode=PF' + + def get_article_url(self, article): + rawarticle = article.get('origlink', None) + artls, sep, rsep = rawarticle.rpartition('/?') + if artls == '': + artls = rawarticle.rpartition('?')[0] + return artls +