Fix #5797 (Updated recipe for Boston globe)

This commit is contained in:
Kovid Goyal 2010-06-11 13:13:24 -06:00
parent 12adf2e0f4
commit 6b933e5872

View File

@ -1,5 +1,5 @@
__license__ = 'GPL v3' __license__ = 'GPL v3'
__copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>' __copyright__ = '2009-2010, Darko Miletic <darko.miletic at gmail.com>'
''' '''
www.boston.com www.boston.com
''' '''
@ -7,10 +7,10 @@ www.boston.com
from calibre.web.feeds.recipes import BasicNewsRecipe from calibre.web.feeds.recipes import BasicNewsRecipe
class BusinessStandard(BasicNewsRecipe): class BusinessStandard(BasicNewsRecipe):
title = 'Boston' title = 'The Boston Globe'
__author__ = 'Darko Miletic' __author__ = 'Darko Miletic'
description = 'News from Boston' description = 'News from Boston'
oldest_article = 7 oldest_article = 2
max_articles_per_feed = 100 max_articles_per_feed = 100
no_stylesheets = True no_stylesheets = True
delay = 1 delay = 1
@ -19,6 +19,9 @@ class BusinessStandard(BasicNewsRecipe):
publisher = 'Boston' publisher = 'Boston'
category = 'news, boston, usa, world' category = 'news, boston, usa, world'
language = 'en' language = 'en'
publication_type = 'newspaper'
masthead_url = 'http://cache.boston.com/images/globe/grslider/the_boston_globe.gif'
extra_css = ' body{font-family: Georgia, serif} div#articleBodyTop{display:block} '
conversion_options = { conversion_options = {
'comments' : description 'comments' : description
@ -27,8 +30,11 @@ class BusinessStandard(BasicNewsRecipe):
,'publisher' : publisher ,'publisher' : publisher
} }
keep_only_tags = [dict(name='div', attrs={'class':'story'})] keep_only_tags = [dict(attrs={'id':['INDblogEntry','blogEntry','articleHeader','articleGraphs','galleryShell']})]
remove_tags = [dict(name=['object','link','script','iframe'])] remove_tags = [
dict(name=['object','link','script','iframe'])
,dict(attrs={'id':['blogheadTools','bdc_emailWidget','tools','relatedContent']})
]
feeds = [ feeds = [
(u'Top Stories' , u'http://feeds.boston.com/boston/topstories' ) (u'Top Stories' , u'http://feeds.boston.com/boston/topstories' )
@ -38,12 +44,9 @@ class BusinessStandard(BasicNewsRecipe):
] ]
def print_version(self, url): def print_version(self, url):
return url + '?mode=PF' return url + '?page=full'
def get_article_url(self, article): def get_article_url(self, article):
rawarticle = article.get('pheedo_origlink', None) rawarticle = article.get('guid', None)
artls, sep, rsep = rawarticle.rpartition('/?') return rawarticle.rpartition('?')[0]
if artls == '':
artls = rawarticle.rpartition('?')[0]
return artls