New recipe for boston.com by Darko Miletic

This commit is contained in:
Kovid Goyal 2009-12-17 11:27:56 -07:00
parent 611231ea59
commit 2c0de47f90

View File

@ -0,0 +1,49 @@
__license__ = 'GPL v3'
__copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>'
'''
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