1
0
mirror of https://gitlab.com/simple-stock-bots/simple-telegram-stock-bot.git synced 2025-07-25 23:51:32 +00:00

Ticker news now uses IEX news api #8 #3

This commit is contained in:
2019-02-12 19:58:44 -07:00
parent df7d69526e
commit 7485285426
2 changed files with 17 additions and 14 deletions

View File

@@ -84,9 +84,11 @@ def news(bot, update):
message + ", the stock hasn't shown any movement today."
)
news = tickerInfo.stockNewsList(ticker)
for source in news:
message = message + "\n[" + source + "](" + news[source] + ")"
news = tickerInfo.stockNews(ticker)
for i in range(3):
message = "{}\n[{}]({})".format(
message, news["title"][i], news["link"][i]
)
update.message.reply_text(
text=message, parse_mode=telegram.ParseMode.MARKDOWN