Coin News OpenClaw
Collect cryptocurrency news from configurable sources, normalize the articles, score relevance, and return a structured digest that can be tuned over time.
Use This Skill When
- - The user wants a daily or on-demand crypto news digest
- The user wants news for a specific token or narrative
- The user wants to replace or compare against an existing Dify news workflow
- The user wants a configurable pipeline that PA can tune later
Workflow
- 1. Read
references/sources.yaml to determine enabled sources and source weights. - Read
references/scoring.yaml to determine token aliases, topic keywords, negative keywords, and ranking logic. - If deterministic collection is needed, run
scripts/fetch_coin_news.py. - Filter the normalized article list to the user’s requested scope.
- Rank articles using source weight, keyword matches, recency, and duplicate suppression.
- Return a short digest or a structured JSON array for downstream workflow use.
CLI Usage
CODEBLOCK0
Output Formats
JSON (default)
python3 scripts/fetch_coin_news.py --days 1
Returns structured JSON for programmatic use.
Markdown (recommended for reading)
python3 scripts/fetch_coin_news.py --days 1 --format markdown
Returns formatted markdown with
clickable links for each article:
CODEBLOCK3
Time Range
- - Default: last 24 hours
- Support explicit day windows such as:
- recent 2 days
- recent 3 days
- recent 7 days
- - Support common Chinese requests such as:
- 最近2天
- 最近3天
- 最近一周
- 过去7天
- - For deterministic runs, prefer
--days <n> over manually converting to hours. - If both
--days and --hours are provided, --days takes precedence. - Recommended mapping:
- 最近2天 ->
--days 2
- 最近3天 ->
--days 3
- 最近一周 ->
--days 7
- 过去7天 -> INLINECODE10
Dynamic Token Fetching
The skill automatically fetches the top 100 tokens (by market cap) from CoinGecko API and merges them with the YAML config:
- - Source: CoinGecko API (free, no API key required)
- Cache TTL: 24 hours (stored in
scoring.yaml under dynamic_tokens) - Merge logic: YAML
token_aliases overrides dynamic tokens (for manual tuning) - Disable: Use
--no-dynamic-tokens to use only YAML config
Output Contract
Prefer this JSON structure for workflow handoff:
CODEBLOCK4
Tuning Rules
- - Do not hardcode source lists in prompts. Update
references/sources.yaml. - Do not hardcode scoring logic in prompts. Update
references/scoring.yaml. - Prefer established publications before secondary aggregators.
- If the user asks for “latest” or “today”, prioritize the last 24 hours and show exact dates.
References
- -
references/sources.yaml: source registry and weights - INLINECODE18 : token aliases, topic keywords, penalties, thresholds
- INLINECODE19 : deterministic RSS collector and scorer
Coin News OpenClaw
从可配置来源收集加密货币新闻,对文章进行标准化处理,评估相关性,并返回可随时间调整的结构化摘要。
使用场景
- - 用户需要每日或按需的加密货币新闻摘要
- 用户需要特定代币或主题的新闻
- 用户希望替换或对比现有的Dify新闻工作流
- 用户需要可配置的管道,PA可后续调整
工作流程
- 1. 读取references/sources.yaml以确定启用的来源及其权重
- 读取references/scoring.yaml以确定代币别名、主题关键词、负面关键词及排序逻辑
- 如需确定性采集,运行scripts/fetchcoinnews.py
- 将标准化后的文章列表按用户请求范围进行过滤
- 根据来源权重、关键词匹配、时效性和去重机制对文章进行排序
- 返回简短摘要或结构化JSON数组,供下游工作流使用
CLI使用方式
bash
基本用法 - JSON输出(默认)
python3 scripts/fetch
coinnews.py --days 1
⭐ Markdown输出(含可点击链接,推荐阅读)
python3 scripts/fetch
coinnews.py --days 1 --format markdown
限制文章数量
python3 scripts/fetch
coinnews.py --days 1 --limit 10 --format markdown
按特定代币过滤
python3 scripts/fetch
coinnews.py --days 1 --token BTC --token ETH
按特定主题过滤
python3 scripts/fetch
coinnews.py --days 1 --topic etf --topic regulation
调整代币获取上限(默认:100,最大:250)
python3 scripts/fetch
coinnews.py --days 1 --token-limit 50
禁用动态代币获取(仅使用YAML配置)
python3 scripts/fetch
coinnews.py --days 1 --no-dynamic-tokens
输出格式
JSON(默认)
bash
python3 scripts/fetch
coinnews.py --days 1
返回结构化JSON,适用于程序化使用。
Markdown(推荐阅读)
bash
python3 scripts/fetch
coinnews.py --days 1 --format markdown
返回格式化Markdown,每篇文章包含可点击链接:
markdown
来源: CoinDesk |
时间: 2026-03-25 |
分数: 78
代币: BTC, ETH
主题: etf
摘要文本...
时间范围
- 最近2天
- 最近3天
- 最近7天
- 最近2天
- 最近3天
- 最近一周
- 过去7天
- - 确定性运行时,优先使用--days 而非手动转换为小时
- 若同时提供--days和--hours,--days优先
- 推荐映射:
- 最近2天 -> --days 2
- 最近3天 -> --days 3
- 最近一周 -> --days 7
- 过去7天 -> --days 7
动态代币获取
该技能自动从CoinGecko API获取市值前100的代币,并与YAML配置合并:
- - 来源: CoinGecko API(免费,无需API密钥)
- 缓存有效期: 24小时(存储在scoring.yaml的dynamictokens下)
- 合并逻辑: YAML中的tokenaliases覆盖动态代币(用于手动调整)
- 禁用: 使用--no-dynamic-tokens仅使用YAML配置
输出契约
工作流交接时优先使用以下JSON结构:
json
[
{
title: 示例标题,
url: https://example.com/article,
source: CoinDesk,
published_at: 2026-03-20T09:00:00Z,
summary: 一段摘要。,
score: 78,
matched_topics: [bitcoin, etf],
matched_tokens: [BTC],
duplicategroupkey: normalized-title-key
}
]
调优规则
- - 不要在提示词中硬编码来源列表。更新references/sources.yaml。
- 不要在提示词中硬编码评分逻辑。更新references/scoring.yaml。
- 优先选择知名出版物,其次才是二级聚合器。
- 若用户要求最新或今天,优先显示最近24小时并标注具体日期。
参考资料
- - references/sources.yaml:来源注册表及权重
- references/scoring.yaml:代币别名、主题关键词、惩罚项、阈值
- scripts/fetchcoinnews.py:确定性RSS采集与评分器