mirror of
https://gitlab.com/simple-stock-bots/simple-stock-bot.git
synced 2025-06-16 15:17:28 +00:00
/close #74
This commit is contained in:
parent
0bac96cbd7
commit
f34fd37597
@ -25,6 +25,7 @@ class IEX_Symbol:
|
|||||||
searched_symbols = {}
|
searched_symbols = {}
|
||||||
otc_list = []
|
otc_list = []
|
||||||
charts = {}
|
charts = {}
|
||||||
|
trending_cache = ["Trending Stocks Currently Unavailable."]
|
||||||
|
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
"""Creates a Symbol Object
|
"""Creates a Symbol Object
|
||||||
@ -494,9 +495,9 @@ class IEX_Symbol:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
if data := self.get(f"/stock/market/list/mostactive"):
|
if data := self.get(f"/stock/market/list/mostactive"):
|
||||||
return [
|
self.trending_cache = [
|
||||||
f"`${s['symbol']}`: {s['companyName']}, {100*s['changePercent']:.2f}%"
|
f"`${s['symbol']}`: {s['companyName']}, {100*s['changePercent']:.2f}%"
|
||||||
for s in data
|
for s in data
|
||||||
]
|
]
|
||||||
else:
|
|
||||||
return ["Trending Stocks Currently Unavailable."]
|
return self.trending_cache
|
||||||
|
@ -22,6 +22,7 @@ class cg_Crypto:
|
|||||||
vs_currency = "usd" # simple/supported_vs_currencies for list of options
|
vs_currency = "usd" # simple/supported_vs_currencies for list of options
|
||||||
|
|
||||||
searched_symbols = {}
|
searched_symbols = {}
|
||||||
|
trending_cache = ["Trending Coins Currently Unavailable."]
|
||||||
|
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
"""Creates a Symbol Object
|
"""Creates a Symbol Object
|
||||||
@ -368,8 +369,9 @@ class cg_Crypto:
|
|||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.warning(e)
|
logging.warning(e)
|
||||||
trending = ["Trending Coins Currently Unavailable."]
|
return self.trending_cache
|
||||||
|
|
||||||
|
self.trending_cache = trending
|
||||||
return trending
|
return trending
|
||||||
|
|
||||||
def batch_price(self, coins: list[Coin]) -> list[str]:
|
def batch_price(self, coins: list[Coin]) -> list[str]:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user