Fix #3655 (Fixed recipe for Honolulu Advertiser)

This commit is contained in:
Kovid Goyal 2009-10-01 11:02:37 -06:00
parent 407a64c7e9
commit e9bb0ee6af

View File

@ -16,26 +16,22 @@ class Honoluluadvertiser(BasicNewsRecipe):
category = 'news, Honolulu, Hawaii' category = 'news, Honolulu, Hawaii'
oldest_article = 2 oldest_article = 2
language = 'en' language = 'en'
max_articles_per_feed = 100 max_articles_per_feed = 100
no_stylesheets = True no_stylesheets = True
use_embedded_content = False use_embedded_content = False
encoding = 'cp1252' encoding = 'cp1252'
remove_javascript = True
cover_url = 'http://www.honoluluadvertiser.com/graphics/branding.gif'
html2lrf_options = [ conversion_options = {
'--comment' , description 'comments' : description
, '--category' , category ,'tags' : category
, '--publisher' , publisher ,'language' : language
] ,'publisher' : publisher
}
html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"'
keep_only_tags = [dict(name='td')] keep_only_tags = [dict(name='td')]
remove_tags = [dict(name=['object','link'])] remove_tags = [dict(name=['object','link'])]
remove_attributes = ['style']
feeds = [ feeds = [
(u'Breaking news', u'http://www.honoluluadvertiser.com/apps/pbcs.dll/section?Category=RSS01&MIME=XML' ) (u'Breaking news', u'http://www.honoluluadvertiser.com/apps/pbcs.dll/section?Category=RSS01&MIME=XML' )
@ -47,14 +43,13 @@ class Honoluluadvertiser(BasicNewsRecipe):
] ]
def preprocess_html(self, soup): def preprocess_html(self, soup):
for item in soup.findAll(style=True): st = soup.find('td')
del item['style'] if st:
mtag = '\n<meta http-equiv="Content-Language" content="en"/>\n' st.name = 'div'
soup.head.insert(0,mtag)
return soup return soup
def print_version(self, url): def print_version(self, url):
ubody, sep, rest = url.rpartition('/-1/') ubody, sep, rest = url.rpartition('?source')
root, sep2, article_id = ubody.partition('/article/') root, sep2, article_id = ubody.partition('/article/')
return u'http://www.honoluluadvertiser.com/apps/pbcs.dll/article?AID=/' + article_id + '&template=printart' return u'http://www.honoluluadvertiser.com/apps/pbcs.dll/article?AID=/' + article_id + '&template=printart'