mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Update Honolulu Star Advertiser
This commit is contained in:
parent
6ac2cea0d6
commit
7b4c73c111
@ -1,5 +1,5 @@
|
|||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2009-2011, Darko Miletic <darko.miletic at gmail.com>'
|
__copyright__ = '2011, M. Ching modified from work 2009-2011 Darko Miletic <darko.miletic at gmail.com>'
|
||||||
'''
|
'''
|
||||||
staradvertiser.com
|
staradvertiser.com
|
||||||
'''
|
'''
|
||||||
@ -7,12 +7,13 @@ staradvertiser.com
|
|||||||
from calibre.web.feeds.news import BasicNewsRecipe
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
|
||||||
class Starbulletin(BasicNewsRecipe):
|
class Starbulletin(BasicNewsRecipe):
|
||||||
title = 'Honolulu Star Advertiser'
|
title = 'Honolulu Star-Advertiser'
|
||||||
__author__ = 'Darko Miletic'
|
__author__ = 'Darko Miletic'
|
||||||
description = 'Latest national and local Hawaii sports news'
|
description = 'Latest national and local Hawaii sports news'
|
||||||
publisher = 'Honolulu Star-Advertiser'
|
publisher = 'Honolulu Star-Advertiser'
|
||||||
category = 'news, Honolulu, Hawaii'
|
category = 'news, Honolulu, Hawaii'
|
||||||
oldest_article = 2
|
oldest_article = 2
|
||||||
|
needs_subscription = True
|
||||||
max_articles_per_feed = 100
|
max_articles_per_feed = 100
|
||||||
language = 'en'
|
language = 'en'
|
||||||
no_stylesheets = True
|
no_stylesheets = True
|
||||||
@ -20,12 +21,12 @@ class Starbulletin(BasicNewsRecipe):
|
|||||||
encoding = 'utf8'
|
encoding = 'utf8'
|
||||||
publication_type = 'newspaper'
|
publication_type = 'newspaper'
|
||||||
masthead_url = 'http://media.staradvertiser.com/designimages/star-advertiser-logo-small.gif'
|
masthead_url = 'http://media.staradvertiser.com/designimages/star-advertiser-logo-small.gif'
|
||||||
extra_css = """
|
# extra_css = """
|
||||||
body{font-family: Verdana,Arial,Helvetica,sans-serif}
|
# body{font-family: Verdana,Arial,Helvetica,sans-serif}
|
||||||
h1,.brown,.postCredit{color: #663300}
|
# h1,.brown,.hsa_postCredit{color: #663300}
|
||||||
.storyDeck{font-size: 1.2em; font-weight: bold}
|
# .storyDeck{font-size: 1.2em; font-weight: bold}
|
||||||
img{display: block}
|
# img{display: block}
|
||||||
"""
|
# """
|
||||||
|
|
||||||
conversion_options = {
|
conversion_options = {
|
||||||
'comment' : description
|
'comment' : description
|
||||||
@ -35,26 +36,36 @@ class Starbulletin(BasicNewsRecipe):
|
|||||||
, 'linearize_tables' : True
|
, 'linearize_tables' : True
|
||||||
}
|
}
|
||||||
keep_only_tags = [
|
keep_only_tags = [
|
||||||
dict(attrs={'id':'storyTitle'})
|
dict(attrs={'id':'hsa_storyTitle'})
|
||||||
,dict(attrs={'class':['storyDeck','postCredit']})
|
,dict(attrs={'class':['hsa_dateStamp','hsa_postCredit','storyDeck']})
|
||||||
,dict(name='span',attrs={'class':'brown'})
|
,dict(name='span',attrs={'class':['hsa_dateStamp','hsa_postCredit']})
|
||||||
|
,dict(name='div',attrs={'class':'storytext article-important'})
|
||||||
,dict(name='div',attrs={'class':'storytext'})
|
,dict(name='div',attrs={'class':'storytext'})
|
||||||
]
|
]
|
||||||
remove_tags = [
|
remove_tags = [
|
||||||
dict(name=['object','link','script','span','meta','base','iframe'])
|
dict(name=['object','link','script','meta','base','iframe'])
|
||||||
|
# removed 'span' from preceding list to permit keeping of author and timestamp
|
||||||
,dict(attrs={'class':['insideStoryImage','insideStoryAd']})
|
,dict(attrs={'class':['insideStoryImage','insideStoryAd']})
|
||||||
,dict(attrs={'name':'fb_share'})
|
,dict(attrs={'name':'fb_share'})
|
||||||
]
|
]
|
||||||
|
|
||||||
feeds = [
|
def get_browser(self):
|
||||||
(u'Headlines' , u'http://www.staradvertiser.com/staradvertiser_headlines.rss' )
|
br = BasicNewsRecipe.get_browser()
|
||||||
,(u'News' , u'http://www.staradvertiser.com/news/index.rss' )
|
if self.username is not None and self.password is not None:
|
||||||
,(u'Sports' , u'http://www.staradvertiser.com/sports/index.rss' )
|
br.open('http://www.staradvertiser.com/manage/Login/')
|
||||||
,(u'Features' , u'http://www.staradvertiser.com/features/index.rss' )
|
br.select_form(name='loginForm')
|
||||||
,(u'Editorials', u'http://www.staradvertiser.com/editorials/index.rss' )
|
br['email'] = self.username
|
||||||
,(u'Business' , u'http://www.staradvertiser.com/business/index.rss' )
|
br['password'] = self.password
|
||||||
,(u'Travel' , u'http://www.staradvertiser.com/travel/index.rss' )
|
br.submit()
|
||||||
]
|
return br
|
||||||
|
|
||||||
|
feeds = [
|
||||||
|
(u'Breaking News', u'http://www.staradvertiser.com/news/breaking/index.rss')
|
||||||
|
,(u'News', u'http://www.staradvertiser.com/newspremium/index.rss')
|
||||||
|
,(u'Business', u'http://www.staradvertiser.com/businesspremium/index.rss')
|
||||||
|
,(u'Sports', u'http://www.staradvertiser.com/sportspremium/index.rss')
|
||||||
|
,(u'Features', u'http://www.staradvertiser.com/featurespremium/index.rss')
|
||||||
|
]
|
||||||
|
|
||||||
def preprocess_html(self, soup):
|
def preprocess_html(self, soup):
|
||||||
for item in soup.findAll(style=True):
|
for item in soup.findAll(style=True):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user