From 3f7c896c1a89c878606c230c20ec46af537928e8 Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Sat, 23 Nov 2024 12:00:16 +0100 Subject: [PATCH] add market cap to dashboard --- app/cron_dashboard.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/cron_dashboard.py b/app/cron_dashboard.py index deab2be..9498fc1 100644 --- a/app/cron_dashboard.py +++ b/app/cron_dashboard.py @@ -335,11 +335,11 @@ async def run(): try: with open(f"json/market-movers/premarket/gainers.json", 'r') as file: data = ujson.load(file) - gainers = [{ 'symbol': item['symbol'], 'name': item['name'], 'price': item['price'], 'changesPercentage': item['changesPercentage']} for item in data[:5]] + gainers = [{ 'symbol': item['symbol'], 'name': item['name'], 'price': item['price'], 'changesPercentage': item['changesPercentage'], 'marketCap': item['marketCap']} for item in data[:5]] with open(f"json/market-movers/premarket/losers.json", 'r') as file: data = ujson.load(file) - losers = [{ 'symbol': item['symbol'], 'name': item['name'], 'price': item['price'], 'changesPercentage': item['changesPercentage']} for item in data[:5]] + losers = [{ 'symbol': item['symbol'], 'name': item['name'], 'price': item['price'], 'changesPercentage': item['changesPercentage'], 'marketCap': item['marketCap']} for item in data[:5]] market_movers={'gainers': gainers, 'losers': losers} except: @@ -348,11 +348,11 @@ async def run(): try: with open(f"json/market-movers/afterhours/gainers.json", 'r') as file: data = ujson.load(file) - gainers = [{ 'symbol': item['symbol'], 'name': item['name'], 'price': item['price'], 'changesPercentage': item['changesPercentage']} for item in data[:5]] + gainers = [{ 'symbol': item['symbol'], 'name': item['name'], 'price': item['price'], 'changesPercentage': item['changesPercentage'], 'marketCap': item['marketCap']} for item in data[:5]] with open(f"json/market-movers/afterhours/losers.json", 'r') as file: data = ujson.load(file) - losers = [{ 'symbol': item['symbol'], 'name': item['name'], 'price': item['price'], 'changesPercentage': item['changesPercentage']} for item in data[:5]] + losers = [{ 'symbol': item['symbol'], 'name': item['name'], 'price': item['price'], 'changesPercentage': item['changesPercentage'], 'marketCap': item['marketCap']} for item in data[:5]] market_movers={'gainers': gainers, 'losers': losers}