summaryrefslogtreecommitdiff
path: root/binance-announcements-scraping-bot.py
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2021-09-16 17:27:22 +0300
committerEvgeny Zinoviev <me@ch1p.io>2021-09-16 17:27:22 +0300
commit473e160f1df08847663aad6d9d3c667552d0f8a7 (patch)
tree00860fa90b7dca7a3f563a6ce53a202e9a076a17 /binance-announcements-scraping-bot.py
parent7be17ff7ef6efd38d4dd013042bbf1a42332601b (diff)
fixes
Diffstat (limited to 'binance-announcements-scraping-bot.py')
-rwxr-xr-xbinance-announcements-scraping-bot.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/binance-announcements-scraping-bot.py b/binance-announcements-scraping-bot.py
index ad57314..7809470 100755
--- a/binance-announcements-scraping-bot.py
+++ b/binance-announcements-scraping-bot.py
@@ -29,9 +29,12 @@ def scrap_announcements():
if not link.get('id').startswith('supportList'):
continue
+ href = link.get('href')
+ if href.startswith('/'):
+ href = f'https://www.binance.com{href}'
category_data['news'].append({
'text': link.text,
- 'link': link.get('href')
+ 'link': href
})
total_news += 1
@@ -56,15 +59,14 @@ if __name__ == '__main__':
state['urls'].append(item['link'])
if updates:
- buf = f"<i>{category['title']}</i>\n"
- buf += '\n'.join(list(map(lambda item: f"<a href=\"{item['link']}\">{item['text']}</a>", updates)))
+ buf = f"<b>{category['title']}</b>\n"
+ buf += '\n'.join(list(map(lambda item: f"<a href='{item['link']}'>{item['text']}</a>", updates)))
blocks.append(buf)
if blocks:
message = '<b>Binance Announcements</b>\n\n'
message += '\n\n'.join(blocks)
-
- telegram_notify(text=message, parse_mode='HTML')
+ telegram_notify(text=message, parse_mode='HTML', disable_web_page_preview=True)
except:
telegram_notify(text='error: ' + escape(traceback.format_exc()), parse_mode='HTML') \ No newline at end of file