mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #3655 (Fixed recipe for Honolulu Advertiser)
This commit is contained in:
parent
407a64c7e9
commit
e9bb0ee6af
@ -1,60 +1,55 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>'
|
__copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>'
|
||||||
'''
|
'''
|
||||||
honoluluadvertiser.com
|
honoluluadvertiser.com
|
||||||
'''
|
'''
|
||||||
|
|
||||||
from calibre.web.feeds.news import BasicNewsRecipe
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
|
||||||
class Honoluluadvertiser(BasicNewsRecipe):
|
class Honoluluadvertiser(BasicNewsRecipe):
|
||||||
title = 'Honolulu Advertiser'
|
title = 'Honolulu Advertiser'
|
||||||
__author__ = 'Darko Miletic'
|
__author__ = 'Darko Miletic'
|
||||||
description = "Latest national and local Hawaii sports news from The Honolulu Advertiser."
|
description = "Latest national and local Hawaii sports news from The Honolulu Advertiser."
|
||||||
publisher = 'Honolulu Advertiser'
|
publisher = 'Honolulu Advertiser'
|
||||||
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
|
conversion_options = {
|
||||||
cover_url = 'http://www.honoluluadvertiser.com/graphics/branding.gif'
|
'comments' : description
|
||||||
|
,'tags' : category
|
||||||
html2lrf_options = [
|
,'language' : language
|
||||||
'--comment' , description
|
,'publisher' : publisher
|
||||||
, '--category' , category
|
}
|
||||||
, '--publisher' , publisher
|
|
||||||
]
|
keep_only_tags = [dict(name='td')]
|
||||||
|
|
||||||
html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"'
|
remove_tags = [dict(name=['object','link'])]
|
||||||
|
remove_attributes = ['style']
|
||||||
keep_only_tags = [dict(name='td')]
|
|
||||||
|
feeds = [
|
||||||
remove_tags = [dict(name=['object','link'])]
|
(u'Breaking news', u'http://www.honoluluadvertiser.com/apps/pbcs.dll/section?Category=RSS01&MIME=XML' )
|
||||||
|
,(u'Local news', u'http://www.honoluluadvertiser.com/apps/pbcs.dll/section?Category=RSS02&MIME=XML' )
|
||||||
|
,(u'Sports', u'http://www.honoluluadvertiser.com/apps/pbcs.dll/section?Category=RSS03&MIME=XML' )
|
||||||
feeds = [
|
,(u'Island life', u'http://www.honoluluadvertiser.com/apps/pbcs.dll/section?Category=RSS05&MIME=XML' )
|
||||||
(u'Breaking news', u'http://www.honoluluadvertiser.com/apps/pbcs.dll/section?Category=RSS01&MIME=XML' )
|
,(u'Entertainment', u'http://www.honoluluadvertiser.com/apps/pbcs.dll/section?Category=RSS06&MIME=XML' )
|
||||||
,(u'Local news', u'http://www.honoluluadvertiser.com/apps/pbcs.dll/section?Category=RSS02&MIME=XML' )
|
,(u'Business', u'http://www.honoluluadvertiser.com/apps/pbcs.dll/section?Category=RSS04&MIME=XML' )
|
||||||
,(u'Sports', u'http://www.honoluluadvertiser.com/apps/pbcs.dll/section?Category=RSS03&MIME=XML' )
|
]
|
||||||
,(u'Island life', u'http://www.honoluluadvertiser.com/apps/pbcs.dll/section?Category=RSS05&MIME=XML' )
|
|
||||||
,(u'Entertainment', u'http://www.honoluluadvertiser.com/apps/pbcs.dll/section?Category=RSS06&MIME=XML' )
|
def preprocess_html(self, soup):
|
||||||
,(u'Business', u'http://www.honoluluadvertiser.com/apps/pbcs.dll/section?Category=RSS04&MIME=XML' )
|
st = soup.find('td')
|
||||||
]
|
if st:
|
||||||
|
st.name = 'div'
|
||||||
def preprocess_html(self, soup):
|
return soup
|
||||||
for item in soup.findAll(style=True):
|
|
||||||
del item['style']
|
def print_version(self, url):
|
||||||
mtag = '\n<meta http-equiv="Content-Language" content="en"/>\n'
|
ubody, sep, rest = url.rpartition('?source')
|
||||||
soup.head.insert(0,mtag)
|
root, sep2, article_id = ubody.partition('/article/')
|
||||||
return soup
|
return u'http://www.honoluluadvertiser.com/apps/pbcs.dll/article?AID=/' + article_id + '&template=printart'
|
||||||
|
|
||||||
def print_version(self, url):
|
|
||||||
ubody, sep, rest = url.rpartition('/-1/')
|
|
||||||
root, sep2, article_id = ubody.partition('/article/')
|
|
||||||
return u'http://www.honoluluadvertiser.com/apps/pbcs.dll/article?AID=/' + article_id + '&template=printart'
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user