This commit is contained in:
Kovid Goyal 2023-07-18 11:26:18 +05:30
commit a7cf59b8f8
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 8 additions and 8 deletions

View File

@ -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 = 3 # seconds delay = 7 # seconds
extra_css = ''' extra_css = '''
#auth {font-size:small; font-weight:bold;} #auth {font-size:small; font-weight:bold;}
#time, .chart {font-size:small;} #time, .chart {font-size:small;}
@ -146,17 +146,17 @@ class Bloomberg(BasicNewsRecipe):
if item['type'] == 'text' and item['value']: if item['type'] == 'text' and item['value']:
body += item['value'] body += item['value']
elif item['type'] == 'link' and item['data']: if item['type'] == 'link' and item['data']:
if 'href' not in item['data']: if 'href' not in item['data']:
continue continue
if item['content'] and item['content'][0] and item['content'][0]['value']: if item['content'] and item['content'][0] and item['content'][0]['value']:
body += '<a href="' + item['data']['href'] + '">' + item['content'][0]['value'] + '</a>' body += '<a href="' + item['data']['href'] + '">' + item['content'][0]['value'] + '</a>'
elif item['type'] == 'entity': if item['type'] == 'entity':
if item['content'] and item['content'][0] and item['content'][0]['value']: if item['content'] and item['content'][0] and item['content'][0]['value']:
if item['subType'] == 'person' or 'security': if item['subType'] == 'person' or 'security':
body += item['content'][0]['value'] body += item['content'][0]['value']
elif item['subType'] == 'story': if item['subType'] == 'story':
if item['data'] and item['data']['link'] and item['data']['link']['destination'] and item['data']['link']['destination']['web']: if item['data'] and item['data']['link'] and item['data']['link']['destination'] and item['data']['link']['destination']['web']:
body += '<a href="' + item['data']['link']['destination']['web'] + '">' + item.content[0].value + '</a>' body += '<a href="' + item['data']['link']['destination']['web'] + '">' + item.content[0].value + '</a>'

View File

@ -14,7 +14,7 @@ class Bloomberg(BasicNewsRecipe):
ignore_duplicate_articles = {'url', 'title'} ignore_duplicate_articles = {'url', 'title'}
resolve_internal_links = True resolve_internal_links = True
delay = 5 # seconds delay = 7 # seconds
extra_css = ''' extra_css = '''
#auth {font-size:small; font-weight:bold;} #auth {font-size:small; font-weight:bold;}
@ -140,17 +140,17 @@ class Bloomberg(BasicNewsRecipe):
if item['type'] == 'text' and item['value']: if item['type'] == 'text' and item['value']:
body += item['value'] body += item['value']
elif item['type'] == 'link' and item['data']: if item['type'] == 'link' and item['data']:
if 'href' not in item['data']: if 'href' not in item['data']:
continue continue
if item['content'] and item['content'][0] and item['content'][0]['value']: if item['content'] and item['content'][0] and item['content'][0]['value']:
body += '<a href="' + item['data']['href'] + '">' + item['content'][0]['value'] + '</a>' body += '<a href="' + item['data']['href'] + '">' + item['content'][0]['value'] + '</a>'
elif item['type'] == 'entity': if item['type'] == 'entity':
if item['content'] and item['content'][0] and item['content'][0]['value']: if item['content'] and item['content'][0] and item['content'][0]['value']:
if item['subType'] == 'person' or 'security': if item['subType'] == 'person' or 'security':
body += item['content'][0]['value'] body += item['content'][0]['value']
elif item['subType'] == 'story': if item['subType'] == 'story':
if item['data'] and item['data']['link'] and item['data']['link']['destination'] and item['data']['link']['destination']['web']: if item['data'] and item['data']['link'] and item['data']['link']['destination'] and item['data']['link']['destination']['web']:
body += '<a href="' + item['data']['link']['destination']['web'] + '">' + item.content[0].value + '</a>' body += '<a href="' + item['data']['link']['destination']['web'] + '">' + item.content[0].value + '</a>'