bugfixing discord bot
This commit is contained in:
parent
78e2701fce
commit
20562ebf5b
@ -315,6 +315,7 @@ def recent_earnings():
|
|||||||
|
|
||||||
with open(f"json/dashboard/data.json", 'rb') as file:
|
with open(f"json/dashboard/data.json", 'rb') as file:
|
||||||
data = orjson.loads(file.read())['recentEarnings']
|
data = orjson.loads(file.read())['recentEarnings']
|
||||||
|
data = [item for item in data if datetime.fromisoformat(item['date']).date() == today]
|
||||||
|
|
||||||
res_list = []
|
res_list = []
|
||||||
for item in data:
|
for item in data:
|
||||||
@ -327,7 +328,7 @@ def recent_earnings():
|
|||||||
item['marketCap'] = quote_data.get('marketCap',0)
|
item['marketCap'] = quote_data.get('marketCap',0)
|
||||||
item['eps'] = round(quote_data.get('eps',0),2)
|
item['eps'] = round(quote_data.get('eps',0),2)
|
||||||
|
|
||||||
unique_str = f"{item['date']}-{item['symbol']}"
|
unique_str = f"{item['date']}-{item['symbol']}-{item.get('revenueSurprise',0)}-{item.get('epsSurprise',0)}"
|
||||||
item['id'] = hashlib.md5(unique_str.encode()).hexdigest()
|
item['id'] = hashlib.md5(unique_str.encode()).hexdigest()
|
||||||
|
|
||||||
if item['marketCap'] > 1E9:
|
if item['marketCap'] > 1E9:
|
||||||
@ -571,8 +572,8 @@ def analyst_report():
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
#options_flow()
|
options_flow()
|
||||||
#dark_pool_flow()
|
dark_pool_flow()
|
||||||
recent_earnings()
|
recent_earnings()
|
||||||
#executive_order_message()
|
executive_order_message()
|
||||||
#analyst_report()
|
analyst_report()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user