1
0
mirror of https://gitlab.com/simple-stock-bots/simple-stock-bot.git synced 2025-09-12 16:54:59 +00:00
This commit is contained in:
2021-11-06 13:00:00 -07:00
parent c34af4cd40
commit f67cb398ac
2 changed files with 15 additions and 5 deletions

View File

@@ -36,6 +36,9 @@ class IEX_Symbol:
"""
try:
self.IEX_TOKEN = os.environ["IEX"]
if self.IEX_TOKEN == "TOKEN":
self.IEX_TOKEN = ""
except KeyError:
self.IEX_TOKEN = ""
warning(
@@ -122,6 +125,10 @@ class IEX_Symbol:
str
Human readable text on status of IEX API
"""
if self.IEX_TOKEN == "":
return "The `IEX_TOKEN` is not set so Stock Market data is not available."
resp = r.get(
"https://pjmps0c34hp7.statuspage.io/api/v2/status.json",
timeout=15,