news-sentiment
GitHub获取股票近期新闻及情绪分析,支持 yfinance 和 Yahoo RSS 双源抓取。适用于用户询问股票动态、头条或市场影响事件时调用,返回结构化新闻数据及人工情绪判断。
Trigger Scenarios
Install
npx skills add staskh/trading_skills --skill news-sentiment -g -y
SKILL.md
Frontmatter
{
"name": "news-sentiment",
"description": "Get recent news and sentiment for a stock. Use when user asks about news, headlines, sentiment, what's happening with a stock, or recent developments.",
"dependencies": [
"trading-skills"
]
}
News Sentiment
Fetch recent news from Yahoo Finance: yfinance's ticker news first, then Yahoo's per-ticker RSS feed when that comes back empty or fails.
Instructions
Note: If
uvis not installed orpyproject.tomlis not found, replaceuv run pythonwithpythonin all commands below.
uv run python scripts/news.py SYMBOL [--limit LIMIT]
Arguments
SYMBOL- Ticker symbol--limit- Number of articles (default: 10)
Output
Returns JSON with:
articles- Array of recent news with title, publisher, date (YYYY-MM-DD HH:MM ET), link, typecount- Number of articles returnedsource-"yfinance"or"yahoo-rss"note- Withyahoo-rss: items are tagged to the ticker, not necessarily about it, and arrive newest first.publisheris the link's host (oftenfinance.yahoo.com), since the feed carries no publishermessage: "No news found"- both sources answered with no articleserror- no articles and at least one source failed; never read this as "no news"
Present key headlines and note any significant news that could impact the stock. Judge the sentiment from the headlines yourself. With yahoo-rss, skip market-wide stories that are not about the company when assessing its sentiment.
Dependencies
yfinance
Timezone
All timestamps and time-based calculations must use the America/New_York timezone. All JSON output must include generated_at (NY time string) and data_delay fields.
Version History
-
3a3bc45
Current 2026-11-02 13:28
增加 Yahoo RSS 作为 yfinance 失败时的降级方案;优化空结果与错误的区分逻辑;明确日期时区为纽约时间。
- cc30858 2026-07-05 11:04
Dependencies
-
required
trading-skills


