mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
Bloomberg recipes update
increased delay.
This commit is contained in:
parent
258e168687
commit
a655f3cfac
@ -14,7 +14,7 @@ class Bloomberg(BasicNewsRecipe):
|
|||||||
ignore_duplicate_articles = {'url'}
|
ignore_duplicate_articles = {'url'}
|
||||||
resolve_internal_links = True
|
resolve_internal_links = True
|
||||||
masthead_url = 'https://assets.bwbx.io/s3/javelin/public/hub/images/BW-Logo-Black-cc9035fbb3.svg'
|
masthead_url = 'https://assets.bwbx.io/s3/javelin/public/hub/images/BW-Logo-Black-cc9035fbb3.svg'
|
||||||
delay = 2
|
delay = 3 # seconds
|
||||||
extra_css = '''
|
extra_css = '''
|
||||||
#auth {font-size:small; font-weight:bold;}
|
#auth {font-size:small; font-weight:bold;}
|
||||||
#time {font-size:small;}
|
#time {font-size:small;}
|
||||||
@ -94,7 +94,7 @@ class Bloomberg(BasicNewsRecipe):
|
|||||||
subhead = '<div id="subhead"><p>' + data['abstract'][0] + '</p><p>' + data['abstract'][1] + '</p></div>'
|
subhead = '<div id="subhead"><p>' + data['abstract'][0] + '</p><p>' + data['abstract'][1] + '</p></div>'
|
||||||
else:
|
else:
|
||||||
if 'summary' in data:
|
if 'summary' in data:
|
||||||
subhead = '<div id="subhead">' + data['summary'] + '</div>'
|
subhead = '<div id="subhead"><p>' + data['summary'] + '</p></div>'
|
||||||
|
|
||||||
if 'byline' in data:
|
if 'byline' in data:
|
||||||
if data['byline'] is not None:
|
if data['byline'] is not None:
|
||||||
@ -103,12 +103,12 @@ class Bloomberg(BasicNewsRecipe):
|
|||||||
|
|
||||||
if 'ledeImageUrl' in data:
|
if 'ledeImageUrl' in data:
|
||||||
if data['ledeImageUrl'] is not None:
|
if data['ledeImageUrl'] is not None:
|
||||||
lede = '<p><img src="{}">'.format(data['ledeImageUrl'].replace('\\', ''))
|
lede = '<p><img src="{}">'.format(data['ledeImageUrl'])
|
||||||
|
|
||||||
if data['ledeDescription'] is not None:
|
if data['ledeDescription'] is not None:
|
||||||
caption = '<span id="cap">' + data['ledeDescription'] + '</span>'
|
caption = '<span id="cap">' + data['ledeDescription'] + '</span>'
|
||||||
|
|
||||||
body = data['body'].replace('\\', '')
|
body = data['body']
|
||||||
html = '<html><body>' + cat + title + subhead + auth + lede + caption + '<div>' + body
|
html = '<html><body>' + cat + title + subhead + auth + lede + caption + '<div>' + body
|
||||||
return html
|
return html
|
||||||
|
|
||||||
|
@ -13,8 +13,8 @@ class Bloomberg(BasicNewsRecipe):
|
|||||||
remove_attributes = ['style', 'height', 'width']
|
remove_attributes = ['style', 'height', 'width']
|
||||||
ignore_duplicate_articles = {'url', 'title'}
|
ignore_duplicate_articles = {'url', 'title'}
|
||||||
resolve_internal_links = True
|
resolve_internal_links = True
|
||||||
oldest_article = 2 # days
|
|
||||||
delay = 1.5
|
delay = 5 # seconds
|
||||||
|
|
||||||
extra_css = '''
|
extra_css = '''
|
||||||
#auth {font-size:small; font-weight:bold;}
|
#auth {font-size:small; font-weight:bold;}
|
||||||
@ -53,11 +53,11 @@ class Bloomberg(BasicNewsRecipe):
|
|||||||
feeds = [
|
feeds = [
|
||||||
('Features',
|
('Features',
|
||||||
'https://news.google.com/rss/search?q=when:27h+allinurl:bloomberg.com%2Fnews%2Ffeatures%2F&hl=en-US&gl=US&ceid=US:en'),
|
'https://news.google.com/rss/search?q=when:27h+allinurl:bloomberg.com%2Fnews%2Ffeatures%2F&hl=en-US&gl=US&ceid=US:en'),
|
||||||
('News',
|
|
||||||
'https://news.google.com/rss/search?q=when:27h+allinurl:bloomberg.com%2Fnews%2Farticles%2F&hl=en-US&gl=US&ceid=US:en'),
|
|
||||||
('Opinion', 'https://news.google.com/rss/search?q=when:27h+allinurl:bloomberg.com%2Fopinion%2F&hl=en-US&gl=US&ceid=US:en'),
|
('Opinion', 'https://news.google.com/rss/search?q=when:27h+allinurl:bloomberg.com%2Fopinion%2F&hl=en-US&gl=US&ceid=US:en'),
|
||||||
('Newsletters',
|
('Newsletters',
|
||||||
'https://news.google.com/rss/search?q=when:27h+allinurl:bloomberg.com%2Fnews%2Fnewsletters%2F&hl=en-US&gl=US&ceid=US:en'),
|
'https://news.google.com/rss/search?q=when:27h+allinurl:bloomberg.com%2Fnews%2Fnewsletters%2F&hl=en-US&gl=US&ceid=US:en'),
|
||||||
|
('News',
|
||||||
|
'https://news.google.com/rss/search?q=when:27h+allinurl:bloomberg.com%2Fnews%2Farticles%2F&hl=en-US&gl=US&ceid=US:en'),
|
||||||
('Others', 'https://news.google.com/rss/search?q=when:27h+allinurl:bloomberg.com&hl=en-US&gl=US&ceid=US:en')
|
('Others', 'https://news.google.com/rss/search?q=when:27h+allinurl:bloomberg.com&hl=en-US&gl=US&ceid=US:en')
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -84,7 +84,7 @@ class Bloomberg(BasicNewsRecipe):
|
|||||||
subhead = '<div id="subhead"><p>' + data['abstract'][0] + '</p><p>' + data['abstract'][1] + '</p></div>'
|
subhead = '<div id="subhead"><p>' + data['abstract'][0] + '</p><p>' + data['abstract'][1] + '</p></div>'
|
||||||
else:
|
else:
|
||||||
if 'summary' in data:
|
if 'summary' in data:
|
||||||
subhead = '<div id="subhead">' + data['summary'] + '</div>'
|
subhead = '<div id="subhead"><p>' + data['summary'] + '</p></div>'
|
||||||
|
|
||||||
if 'byline' in data:
|
if 'byline' in data:
|
||||||
if data['byline'] is not None:
|
if data['byline'] is not None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user