Spaces:
Running
Running
Benjamin Consolvo
commited on
Commit
·
6e86fbb
1
Parent(s):
841f102
font color
Browse files
app.py
CHANGED
|
@@ -468,7 +468,7 @@ class TradingApp:
|
|
| 468 |
elif symbol and sentiment_symbol == symbol and sentiment_result is None:
|
| 469 |
st.markdown("**Sentiment:** No sentiment available")
|
| 470 |
|
| 471 |
-
# Shrink headlines font, number them, and use white with underline for links
|
| 472 |
if symbol and sentiment_symbol == symbol and article_headlines:
|
| 473 |
st.markdown(
|
| 474 |
"<div style='font-size: 0.75em; margin-bottom: 0.5em;'><b>Recent Headlines:</b></div>",
|
|
@@ -495,7 +495,6 @@ class TradingApp:
|
|
| 495 |
(item.get("title"), item.get("url")) for item in feed if item.get("title")
|
| 496 |
]
|
| 497 |
elif sentiment_source == "AlpacaNews":
|
| 498 |
-
# Fetch Alpaca news with URLs
|
| 499 |
news_items = self.sentiment.alpaca_api.get_news(symbol, limit=5)
|
| 500 |
headlines_with_links = [
|
| 501 |
(item.headline, getattr(item, "url", None)) for item in news_items if hasattr(item, "headline")
|
|
@@ -506,12 +505,9 @@ class TradingApp:
|
|
| 506 |
logger.error(f"Error fetching URLs for headlines: {e}")
|
| 507 |
headlines_with_links = [(headline, None) for headline in article_headlines]
|
| 508 |
|
| 509 |
-
#
|
| 510 |
for idx, (headline, url) in enumerate(headlines_with_links, 1):
|
| 511 |
-
|
| 512 |
-
color = "#fff"
|
| 513 |
-
else:
|
| 514 |
-
color = "#003366"
|
| 515 |
if url:
|
| 516 |
st.markdown(
|
| 517 |
f"<div style='font-size:0.75em; margin-bottom:0.15em; color:{color};'>"
|
|
|
|
| 468 |
elif symbol and sentiment_symbol == symbol and sentiment_result is None:
|
| 469 |
st.markdown("**Sentiment:** No sentiment available")
|
| 470 |
|
| 471 |
+
# Shrink headlines font, number them, and use white with underline for links for all sources
|
| 472 |
if symbol and sentiment_symbol == symbol and article_headlines:
|
| 473 |
st.markdown(
|
| 474 |
"<div style='font-size: 0.75em; margin-bottom: 0.5em;'><b>Recent Headlines:</b></div>",
|
|
|
|
| 495 |
(item.get("title"), item.get("url")) for item in feed if item.get("title")
|
| 496 |
]
|
| 497 |
elif sentiment_source == "AlpacaNews":
|
|
|
|
| 498 |
news_items = self.sentiment.alpaca_api.get_news(symbol, limit=5)
|
| 499 |
headlines_with_links = [
|
| 500 |
(item.headline, getattr(item, "url", None)) for item in news_items if hasattr(item, "headline")
|
|
|
|
| 505 |
logger.error(f"Error fetching URLs for headlines: {e}")
|
| 506 |
headlines_with_links = [(headline, None) for headline in article_headlines]
|
| 507 |
|
| 508 |
+
# Always use white for headline text/links
|
| 509 |
for idx, (headline, url) in enumerate(headlines_with_links, 1):
|
| 510 |
+
color = "#fff"
|
|
|
|
|
|
|
|
|
|
| 511 |
if url:
|
| 512 |
st.markdown(
|
| 513 |
f"<div style='font-size:0.75em; margin-bottom:0.15em; color:{color};'>"
|