Update stock notifications with company names and new schedule times
Add full company names to stock price notifications displayed alongside tickers. Update scheduled message times from hourly to three specific times: market open (9:30 AM ET), noon (12:00 PM ET), and market close (4:00 PM ET). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -33,6 +33,15 @@ class FinnhubAPI(StockAPIBase):
|
||||
Dictionary with stock data or None if unavailable
|
||||
"""
|
||||
try:
|
||||
# Get company name from company profile
|
||||
company_name = None
|
||||
try:
|
||||
profile = self.client.company_profile2(symbol=ticker)
|
||||
company_name = profile.get('name') or ticker.upper()
|
||||
except Exception as e:
|
||||
logger.warning(f"Could not fetch company name for {ticker}: {e}")
|
||||
company_name = ticker.upper()
|
||||
|
||||
# Get current quote data
|
||||
quote = self.client.quote(ticker)
|
||||
|
||||
@@ -56,6 +65,7 @@ class FinnhubAPI(StockAPIBase):
|
||||
|
||||
return {
|
||||
'ticker': ticker.upper(),
|
||||
'company_name': company_name,
|
||||
'current_price': round(current_price, 2),
|
||||
'previous_close': round(previous_close, 2),
|
||||
'change_dollar': round(change_dollar, 2),
|
||||
|
||||
Reference in New Issue
Block a user