从多个来源(Spotify官方博客、工程/研究/新闻室、TechCrunch、The Verge、Music Business等)抓取并汇总Spotify相关新闻。
Spotify 新闻文摘 技能是一项面向实际任务的技能,主要用于Overview. 此技能自动汇总来自9+来源(官方Spotify博客+媒体+社区)的Spotify相关新闻, 调试文章, 将其排在 r 级。它将相关步骤、工具调用和结果整理方式集中到统一流程中,帮助使用者更快完成目标并减少重复操作。
实际使用前应先确认任务范围、数据来源、运行环境、必要权限和关键参数,再依据技能说明逐步执行;若输入条件不完整,应先补齐信息或采用保守配置,避免因错误假设导致结果偏离需求。
执行过程中需要关注工具调用是否成功、接口或依赖是否可用、输出格式是否符合预期,并对异常提示、缺失字段和边界情况进行处理;涉及批量任务时,还应保存进度,避免中断后重复操作。
该技能自动聚合来自 9+ 个来源(Spotify 官方博客 + 媒体 + 社区)的 Spotify 相关新闻,对文章进行去重、按相关性排序,并生成一份格式化的中文简报——每篇文章仅用一句话概括,并附上原始链接。
核心功能:
在任何具备内网访问权限的环境中调度或运行本技能前,请务必阅读本节。
verify=True。请勿添加任何 ssl._create_default_https_context 覆盖逻辑。ALLOWED_DDG_DOMAINS(定义于 scripts/fetch_spotify_news.py 文件顶部)过滤。仅允许知名公开新闻域名;内部主机名将被拒绝。在敏感环境中运行前,请审阅并编辑该白名单列表。config/sources.json 中的基础数据源均为 Spotify 官方 Feed 及少量可信媒体。请勿向 sources.json 中添加内网地址或元数据服务 URL。feedparser、beautifulsoup4、requests、python-dateutil、ddgs。agentTurn 定时任务。请在确认任务前核实目标频道/群组是否为您预期的接收对象。cd /projects/.openclaw/skills/spotify-news-digest python3 scripts/generate_digest.py
python3 scripts/generate_digest.py --hours 168
python3 scripts/generate_digest.py --hours 24 --output /tmp/spotify_digest.md
| 来源 | 类型 | URL / 方法 | 分类 |
|---|---|---|---|
| Spotify Engineering Blog | RSS | engineering.atspotify.com/feed/ |
official |
| Spotify Newsroom | RSS | newsroom.spotify.com/feed/ |
official |
| Spotify Research | RSS | research.atspotify.com/feed/ |
research |
| Spotify Design | RSS | spotify.design/feed |
design |
| TechCrunch Spotify | RSS | techcrunch.com/tag/spotify/feed/ |
media |
| The Verge(已过滤) | RSS | Verge 全量 Feed + 关键词过滤 | media |
| Hacker News Spotify | Algolia API | hn.algolia.com query=spotify |
community |
| DDG News 搜索 | DDGS API | 5 次查询 × 每次 8 条结果 | media/official |
说明: Music Business Worldwide 和 Billboard 的 RSS Feed 存在较高延迟,默认已禁用(
_disabled: true,位于sources.json中)。其文章将通过 DDG News 搜索捕获。
每份简报按分类组织,每条含一句中文摘要:
🎵 Spotify 新闻日报 · YYYY-MM-DD 共 N 条(去重后) ───────────────────────────── 🎵 官方动态(N 条) · [一句话中文总结](Source Name) 🔗 https://... 📰 媒体报道(N 条) · [一句话中文总结](Source Name) 🔗 https://... 🔬 技术研究(N 条) · ... ───────────────────────────── 🤖 由 OpenClaw · spotify-news-digest 自动生成
| 分类键 | 显示标签 |
|---|---|
official |
🎵 官方动态 |
research |
🔬 技术研究 |
design |
🎨 产品设计 |
media |
📰 媒体报道 |
community |
💬 社区讨论 |
industry |
🏭 行业资讯 |
import sys
sys.path.insert(0, '/projects/.openclaw/skills/spotify-news-digest/scripts')
from fetch_spotify_news import SpotifyNewsFetcher
from process_spotify_news import SpotifyNewsProcessor, format_digest
# 获取过去 48 小时的文章
articles = SpotifyNewsFetcher().fetch_all(hours=48)
print(f"Fetched {len(articles)} articles")
# 去重、打分、按分类归组
result = SpotifyNewsProcessor().process(articles, max_output=20)
# 渲染 Markdown 简报
md = format_digest(result, date_str='2026-03-17')
print(md)
当文章未设置 zh_summary 字段时,format_digest() 函数将在输出中保留 [English Title] 占位符。调用方 LLM 应执行以下操作:
generate_digest.py 获取原始结构化结果title + summary 并生成一句中文摘要format_digest() 前设置 item['zh_summary']该两步流程兼顾抓取效率与摘要准确性。
# 示例:LLM 在格式化前填充 zh_summary
for cat_items in result.values():
for item in cat_items:
item['zh_summary'] = llm_summarize_zh(item['title'], item['summary'])
digest = format_digest(result)
请 OpenClaw 创建每日定时任务:
“每天上午 10 点发一份 Spotify 新闻日报到 [群/频道]”
OpenClaw 将创建一个隔离的 agentTurn 定时任务,该任务会:
编辑 config/sources.json:
{
"sources": [
{
"name": "My Custom Source",
"type": "rss",
"url": "https://example.com/feed/",
"language": "en",
"category": "media",
"keyword_filter": "spotify"
}
],
"settings": {
"max_news_per_source": 15,
"final_output_count": 20,
"similarity_threshold": 0.65,
"timeout": 12,
"keyword_filter_default": "spotify"
}
}
keyword_filter:若设置该字段,则仅保留标题或摘要中包含该关键词(不区分大小写)的文章。Spotify 官方 Feed 已天然聚焦 Spotify,可留空。
_disabled: true:标记某数据源为禁用状态,使其在运行时不被加载,但无需删除配置项。
安全提示: 仅可在
sources.json中添加公开新闻域名。请勿添加内网、VPN 或云平台元数据服务 URL —— 这类地址可通过 RSS 直接拉取,绕过域名白名单校验。
若您新增的数据源可通过 DDG News 搜索获取(而非 RSS),还需将其域名添加至 scripts/fetch_spotify_news.py 文件顶部附近的 ALLOWED_DDG_DOMAINS 列表中:
ALLOWED_DDG_DOMAINS: tuple = (
'atspotify.com',
'techcrunch.com',
...
'your-new-domain.com', # ← 在此处添加
)
在 scripts/process_spotify_news.py 中:
processor = SpotifyNewsProcessor(similarity_threshold=0.65) # 0.5 = 激进去重 | 0.8 = 宽松去重
在 process_spotify_news.py 中修改 source_weight:
source_weight = {
'Spotify Engineering Blog': 90,
'Spotify Newsroom': 80,
'TechCrunch': 60,
# 在此处添加自定义信源
}
python3 scripts/generate_digest.py [OPTIONS] 选项: --hours N 时间范围(单位:小时,默认:24) --max N 去重后最多输出文章数(默认:20) --output PATH 将 Markdown 简报保存至指定文件
python3 scripts/fetch_spotify_news.py [OPTIONS] 选项: --hours N 抓取过去 N 小时内发布的文章
最常见原因为 RSS 端点受网络策略限制。
# 测试直连 RSS
curl -I https://engineering.atspotify.com/feed/
# 测试 DDG 搜索备用路径
python3 -c "
from ddgs import DDGS
with DDGS() as d:
r = list(d.news('spotify new feature', max_results=3, timelimit='w'))
print(r)
"
若 RSS 被屏蔽但 DDG 正常工作,技能仍将通过搜索备用路径返回结果。这在受限网络环境中属正常行为。
ddgs 未安装pip3 install ddgs
旧版包名
duckduckgo-search同样支持,可作为备选。
响应缓慢的 RSS 数据源已在 sources.json 中标记为 _disabled: true。如需额外禁用某慢速源,请按如下方式配置:
{ "name": "...", "_disabled": true, ... }
降低相似度阈值:
SpotifyNewsProcessor(similarity_threshold=0.5)
format_digest() 函数会对未翻译标题以 [brackets] 包裹。这是有意为之的设计——调用方 LLM 应在渲染前填充 zh_summary 字段。详见上方 使用示例 → LLM 增强摘要。
spotify-news-digest/
├── SKILL.md ← 当前文档
├── config/
│ └── sources.json ← 新闻源定义与配置
├── scripts/
│ ├── fetch_spotify_news.py ← 多源抓取器(RSS + DDG)
│ ├── process_spotify_news.py ← 去重、打分、格式化
│ └── generate_digest.py ← CLI 入口(抓取 → 处理 → 输出)
└── references/
└── (预留用于未来 API 参考文档)
pip3 install feedparser beautifulsoup4 requests python-dateutil ddgs
| 包名 | 用途 |
|---|---|
feedparser |
RSS Feed 解析 |
beautifulsoup4 |
HTML 摘要清洗 |
requests |
RSS 的 HTTP 请求 |
python-dateutil |
鲁棒的日期解析 |
ddgs |
DuckDuckGo News 搜索备用机制 |
Python 版本要求: 3.8+
timelimit 参数实现时效性过滤。| 版本 | 日期 | 变更内容 |
|---|---|---|
| 1.1.0 | 2026-07-14 | 安全增强:移除 SSL 绕过逻辑,为 DDG 结果新增域名白名单,所有请求显式启用 verify=True,更新安全指引 |
| 1.0.0 | 2026-03-17 | 初始发布:支持 RSS + DDG,集成 9 个来源,支持分类分组与中文摘要 |
相关专题
热门下载
相关下载
精品课程
共6课时 | 54.8万人学习
共89课时 | 134.5万人学习
共49课时 | 82.8万人学习
最新文章