Bloomberg -fixed double words.

when hyperlinks are present the words are duplicated in text.
This commit is contained in:
unkn0w7n 2023-07-18 14:21:31 +05:30
parent e54bad7471
commit 2e2c700fe5
2 changed files with 4 additions and 4 deletions

View File

@ -154,12 +154,12 @@ class Bloomberg(BasicNewsRecipe):
if 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':
body += item['content'][0]['value']
if item['subType'] == 'story': if item['subType'] == 'story':
if item['data'] and item['data']['link'] and item['data']['link']['destination']: if item['data'] and item['data']['link'] and item['data']['link']['destination']:
if 'web' in item['data']['link']['destination']: if 'web' in item['data']['link']['destination']:
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>'
elif item['subType'] == 'person' or 'security':
body += item['content'][0]['value']
if objects['type'] == 'quote': if objects['type'] == 'quote':
if 'content' not in objects: if 'content' not in objects:

View File

@ -148,12 +148,12 @@ class Bloomberg(BasicNewsRecipe):
if 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':
body += item['content'][0]['value']
if item['subType'] == 'story': if item['subType'] == 'story':
if item['data'] and item['data']['link'] and item['data']['link']['destination']: if item['data'] and item['data']['link'] and item['data']['link']['destination']:
if 'web' in item['data']['link']['destination']: if 'web' in item['data']['link']['destination']:
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>'
elif item['subType'] == 'person' or 'security':
body += item['content'][0]['value']
if objects['type'] == 'quote': if objects['type'] == 'quote':
if 'content' not in objects: if 'content' not in objects: