mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Update Today Online - Singapore
This commit is contained in:
parent
a02c47502a
commit
37eacf65b0
@ -14,7 +14,7 @@ class AdvancedUserRecipe1276486274(BasicNewsRecipe):
|
|||||||
language = 'en_SG'
|
language = 'en_SG'
|
||||||
temp_files = []
|
temp_files = []
|
||||||
articles_are_obfuscated = True
|
articles_are_obfuscated = True
|
||||||
masthead_url = 'http://www.todayonline.com/App_Themes/Default/images/icons/TodayOnlineLogo.gif'
|
masthead_url = 'http://www.todayonline.com/sites/all/themes/today/logo.png'
|
||||||
conversion_options = {'linearize_tables':True}
|
conversion_options = {'linearize_tables':True}
|
||||||
extra_css = '''
|
extra_css = '''
|
||||||
.author{font-style: italic; font-size: small}
|
.author{font-style: italic; font-size: small}
|
||||||
@ -23,30 +23,31 @@ class AdvancedUserRecipe1276486274(BasicNewsRecipe):
|
|||||||
.headerStrap{font-weight: bold; font-size: x-large; font-syle: italic}
|
.headerStrap{font-weight: bold; font-size: x-large; font-syle: italic}
|
||||||
.bodyText{font-size: 4px;font-family: Times New Roman;}
|
.bodyText{font-size: 4px;font-family: Times New Roman;}
|
||||||
'''
|
'''
|
||||||
keep_only_tags = [
|
feeds = [
|
||||||
dict(name='div', attrs={'id':['fullPrintBodyHolder']})
|
(u'Hot News', u'http://www.todayonline.com/hot-news/feed'),
|
||||||
|
(u'Singapore', u'http://www.todayonline.com/feed/singapore'),
|
||||||
|
(u'World', u'http://www.todayonline.com/feed/world'),
|
||||||
|
(u'Business', u'http://www.todayonline.com/feed/business'),
|
||||||
|
(u'Tech', u'http://www.todayonline.com/feed/tech'),
|
||||||
|
(u'Voices', u'http://www.todayonline.com/feed/voices'),
|
||||||
|
(u'Commentary', u'http://www.todayonline.com/feed/Commentary'),
|
||||||
|
(u'Daily Focus', u'http://www.todayonline.com/feed/daily-focus'),
|
||||||
|
(u'Lifestyle', u'http://www.todayonline.com/feed/lifestyle'),
|
||||||
|
]
|
||||||
|
keep_only_tags = [
|
||||||
|
dict(name='div', attrs='print-content')
|
||||||
]
|
]
|
||||||
remove_tags_after = [ dict(name='div', attrs={'class':'button'})]
|
|
||||||
|
|
||||||
|
|
||||||
remove_tags = [
|
remove_tags = [
|
||||||
dict(name='div', attrs={'class':['url','button']})
|
dict(name='div', attrs={'class':['url','button']}),
|
||||||
]
|
dict(name='div', attrs={'class':'node-type-print-edition'}),
|
||||||
feeds = [
|
dict(name='div', attrs={'class':['field field-name-field-article-section field-type-taxonomy-term-reference field-label-hidden','field field-name-field-article-abstract field-type-text-long field-label-hidden','authoring']})
|
||||||
(u'Singapore', u'http://www.todayonline.com/RSS/Singapore'),
|
|
||||||
(u'Hot News', u'http://www.todayonline.com/RSS/Hotnews'),
|
|
||||||
(u'Today Online', u'http://www.todayonline.com/RSS/Todayonline'),
|
|
||||||
(u'Voices', u'http://www.todayonline.com/RSS/Voices'),
|
|
||||||
(u'Commentary', u'http://www.todayonline.com/RSS/Commentary'),
|
|
||||||
(u'World', u'http://www.todayonline.com/RSS/World'),
|
|
||||||
(u'Business', u'http://www.todayonline.com/RSS/Business'),
|
|
||||||
(u'Column', u'http://www.todayonline.com/RSS/Columns'),
|
|
||||||
]
|
|
||||||
|
|
||||||
|
]
|
||||||
def get_obfuscated_article(self, url):
|
def get_obfuscated_article(self, url):
|
||||||
br = self.get_browser()
|
br = self.get_browser()
|
||||||
br.open(url)
|
br.open(url)
|
||||||
response = br.follow_link(url_regex = r'/Print/', nr = 0)
|
response = br.follow_link(url_regex = r'/print/', nr = 0)
|
||||||
html = response.read()
|
html = response.read()
|
||||||
self.temp_files.append(PersistentTemporaryFile('_fa.html'))
|
self.temp_files.append(PersistentTemporaryFile('_fa.html'))
|
||||||
self.temp_files[-1].write(html)
|
self.temp_files[-1].write(html)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user