Install
openclaw skills install ai-news-brief自动抓取 AI/算力/大模型/GPU 相关最新资讯简报,使用 Chrome 浏览器自动化绕过反爬,支持多个科技媒体来源,支持PDF生成和邮件推送
openclaw skills install ai-news-brief自动抓取国内外 AI/算力/大模型/GPU/芯片相关最新资讯,生成简报
本 Skill 使用配置文件管理各网站的获取方式,文件位于 scripts/sites_config.json。
| 方式 | 说明 | 速度 |
|---|---|---|
| rss | RSS订阅,最快最稳定 | ⚡⚡⚡ |
| http | HTTP直接请求 | ⚡⚡ |
| chrome | Chrome CDP自动化 | ⚡ |
1. 读取 sites_config.json 配置文件
2. 对每个网站,按 priority 顺序尝试:
- 首选:优先级最高且状态为 working 的方式
- 备选:如果首选失败,尝试其他可用的方式
3. 抓取完成后,自动更新各方式的状态到配置文件
4. 下次运行时,使用更新后的配置
如需手动更新网站配置,可编辑 scripts/sites_config.json:
{
"sites": {
"网站key": {
"name": "网站名",
"url": "主页面URL",
"rss": "RSS地址",
"http": "HTTP地址",
"chrome": "Chrome地址",
"priority": ["rss", "http", "chrome"],
"status": {
"rss": "working/failed/unreachable",
"http": "working/failed/unreachable",
"chrome": "working/failed/unreachable"
}
}
}
}
本 Skill 支持根据用户反馈调整获取的资讯内容。
当用户给出以下反馈时,系统会自动调整:
| 用户输入 | 系统行为 |
|---|---|
| "我喜欢GPU/显卡相关" | 添加关键词 gpu, 显卡, nvidia |
| "不喜欢自动驾驶" | 排除关键词 自动驾驶, 智驾 |
| "想看华为昇腾" | 添加关键词 华为, 昇腾 |
| "不要抖音字节" | 屏蔽来源 字节, 抖音 |
用户配置保存在 scripts/user_config.json:
{
"user_preferences": {
"liked_keywords": ["gpu", "华为"],
"disliked_keywords": ["自动驾驶"],
"liked_sources": [],
"disliked_sources": []
},
"default_keywords": {
"AI基础": ["ai", "人工智能", "大模型", "gpt", ...],
"GPU硬件": ["gpu", "nvidia", "amd", "cuda", ...],
...
}
}
| 分类 | 关键词示例 |
|---|---|
| AI基础 | ai, 人工智能, 大模型, gpt, llm, openai |
| GPU硬件 | gpu, nvidia, amd, intel, cuda, h100 |
| 算力芯片 | 算力, 芯片, 半导体, 处理器, cpu, npu |
| 自动驾驶 | 自动驾驶, 智能驾驶, 特斯拉, fsd |
| 大厂动态 | 华为, 昇腾, 阿里, 百度, 字节, 腾讯 |
每条资讯都会经过可信度评估,帮助用户判断信息质量。
| 等级 | 分数 | 说明 | 来源示例 |
|---|---|---|---|
| A级 | 90+ | 权威来源,可信度最高 | TechCrunch, The Verge, 政府官网 |
| B级 | 70-89 | 专业媒体,可信度较高 | 36kr, 量子位, 虎嗅, 爱范儿 |
| C级 | 50-69 | 一般来源,需核实 | HackerNews, 综合新闻 |
| D级 | <50 | 较低可信,仅供参考 | 论坛, 自媒体 |
# 至少B级可信度
python fetch_ai_news.py --min-credibility B
# 至少70分
python fetch_ai_news.py --min-score 70
{
"title": "OpenAI新模型曝光",
"source": "量子位",
"credibility": {
"score": 80,
"level": "B",
"reasons": ["权威来源", "内容详细"]
}
}
资讯按热点程度排序,GPU相关资讯权重最高:
| 类别 | 关键词 | 权重 |
|---|---|---|
| 🟢 GPU/显卡 | gpu, nvidia, amd, h100, 4090, 5090, RTX | 15 (最高) |
| 🔵 大模型 | 大模型, llm, gpt, openai, claude, deepseek, moE | 12 |
| 🟡 AI基础 | ai, 人工智能, 模型, 训练, 推理 | 10 |
| 🟠 芯片/算力 | 算力, 芯片, 半导体, npu, 华为, 昇腾 | 10 |
| 🔴 自动驾驶 | 自动驾驶, 智驾, 特斯拉, fsd | 8 |
当某个获取方式失败时:
| 失败次数 | 处理方式 |
|---|---|
| 第1-2次 | 继续重试(最多2次) |
| 3次以上 | 自动降低该方式优先级 |
| 后续 | 跳过该方式,尝试其他方式 |
失败记录保存在 scripts/failure_log.json:
使用标题相似度算法去除重复文章:
| 相似度 | 处理 |
|---|---|
| ≥0.6 | 视为重复,保留可信度高的 |
| <0.6 | 视为不同文章 |
相似度检测基于:
Skill 支持抓取政府官网的政策通知:
| 来源 | 类别 | 说明 |
|---|---|---|
| 中国政府网 | 中央政策 | 国务院、部委重要政策 |
| 工信部 | 部委政策 | 工业和信息化相关 |
| 科技部 | 部委政策 | 科技创新、项目申报 |
| 网信办 | 部委政策 | 网络安全、AI监管 |
| 发改委 | 部委政策 | 项目批复、产业政策 |
| 教育部 | 部委政策 | AI教育相关 |
| 财政部 | 部委政策 | 补贴、专项资金 |
| 国家数据局 | 新机构 | 数据、AI政策 |
在获取AI资讯时,可选择是否同时获取政策资讯:
| 类型 | 文件 | 位置 |
|---|---|---|
| AI资讯历史 | news_history.json | scripts/data/ |
| 政策资讯历史 | policy_history.json | scripts/data/ |
# 查询最近3天的资讯
python scripts/incremental_fetch.py --days 3
# 查看统计
python scripts/incremental_fetch.py --stats
使用大模型为文章生成更好的摘要:
文件:scripts/llm_config.json
{
"config": {
"enabled": true,
"provider": "deepseek", // deepseek / qwen / openai
"deepseek": {
"api_key": "your_api_key"
}
}
}
| 服务商 | 模型 | 特点 |
|---|---|---|
| DeepSeek | deepseek-chat | 便宜量大 |
| 阿里Qwen | qwen-plus | 有免费额度 |
| OpenAI | gpt-3.5-turbo | 稳定性好 |
python scripts/llm_summarizer.py
每天自动生成资讯报告:
scripts/reports/
├── ai_news_20260406.html
├── ai_news_20260406.md
└── ai_news_20260406.pdf
需要安装 fpdf2:
pip install fpdf2
在 pdf_config.json 中启用:
{
"config": {
"enabled": true,
"output_dir": "./reports"
}
}
python scripts/report_generator.py
翻译英文AI资讯为中文:
文件:scripts/translator_config.json
{
"config": {
"enabled": true,
"provider": "baidu" // baidu / deep
}
}
Skill 支持将简报发送到邮箱,需要使用者自行配置。
为防止项目更新时覆盖用户配置,请按以下步骤配置:
创建配置目录(如果不存在):
C:\Users\你的用户名\.openclaw\config\~/.openclaw/config/复制配置模板:将 scripts/email_config.json.default 复制到上述目录,并重命名为 ai-news-email.json
填写配置:编辑 ai-news-email.json,填写你的邮箱信息
~/.openclaw/config/# Windows
copy scripts\email_config.json.default %USERPROFILE%\.openclaw\config\ai-news-email.json
# macOS/Linux
cp scripts/email_config.json.default ~/.openclaw/config/ai-news-email.json
ai-news-email.json,设置 smtp_config.enabled: true,填写发件人邮箱和授权码recipient_config.enabled: true,添加收件人邮箱{
"smtp_config": {
"enabled": true,
"smtp_server": "smtp.qq.com",
"smtp_port": 465,
"use_ssl": true,
"sender_email": "your_email@qq.com",
"sender_password": "your_auth_code",
"sender_name": "AI资讯小助手"
},
"recipient_config": {
"enabled": true,
"recipients": ["your_email@example.com"]
}
}
| 邮箱 | SMTP服务器 | 端口 | 授权码获取 |
|---|---|---|---|
| QQ邮箱 | smtp.qq.com | 465 | 邮箱设置→账户→开启IMAP |
| 163邮箱 | smtp.163.com | 465 | 邮箱设置→POP3/SMTP |
| Gmail | smtp.gmail.com | 465 | Google账户→安全→应用密码 |
python scripts/email_sender.py
定时任务需要在 OpenClaw 中手动添加,步骤如下:
openclaw cron add --name "AI资讯简报-早间版" \
--schedule "0 7 * * *" \
--agent main \
--message "请运行 AI 资讯简报技能,获取昨日7点至今日7点的AI/算力/GPU/政策资讯,生成简报,并自动生成 PDF 附件发送到配置好的邮箱" \
--delivery wechat
openclaw cron add --name "AI资讯简报-午间版" \
--schedule "0 14 * * *" \
--agent main \
--message "请运行 AI 资讯简报技能,获取今日最新的AI/算力/GPU/政策资讯,生成简报,并自动生成 PDF 附件发送到配置好的邮箱" \
--delivery wechat
# 查看所有定时任务
openclaw cron list
# 删除定时任务
openclaw cron rm <任务ID>
# 立即运行定时任务(测试)
openclaw cron run <任务ID>
注意:定时任务由 OpenClaw 管理,不是 Skill 代码的一部分。如果需要修改或删除定时任务,请使用上述命令。
ai-news-brief/
├── SKILL.md # Skill 定义文件
├── scripts/ # 代码文件(更新时会被覆盖)
│ ├── *.py # 功能代码
│ └── *.json.default # 默认配置模板(只读,不要修改)
├── user_config/ # ⚠️ 已弃用,请使用外部配置
│ └── *.json # 历史配置(不再使用)
└── data/ # 数据缓存(不会被覆盖)
# 👇 用户配置存放位置(项目外,更新时不会被覆盖)
~/.openclaw/config/
├── ai-news-email.json # 邮件配置
├── ai-news-llm.json # LLM API 配置
├── ai-news-pdf.json # PDF 配置
├── ai-news-user.json # 用户偏好
└── ai-news-sites.json # 网站配置
scripts/ 目录下的所有文件~/.openclaw/config/ 目录scripts/*.json.default 复制模板到 ~/.openclaw/config/首次使用前,可选择自动安装依赖。AI 会询问你是否安装:
我需要安装一些依赖才能运行:
- requests, beautifulsoup4, websocket-client (Python 包)
是否现在安装?请回复"是"或"安装"
在终端运行:
pip install requests beautifulsoup4 websocket-client
当用户说出以下关键词时激活:
# 🤖 AI/算力/GPU 资讯简报
**查询日期**: 2026年4月6日
**数据范围**: 2026年4月5日
---
### 🔥 重点新闻
| 来源 | 标题 | 概要 |
|------|------|------|
| 36kr | 标题 | 概要... |
| 量子位 | 标题 | 概要... |
---
### 📊 来源分布
| 来源 | 数量 |
|------|------|
| 36kr | 10条 |
| 搜狐科技 | 8条 |
---
### 💡 趋势总结
1. 趋势1...
2. 趋势2...
---
Phase 1: 启动 Chrome
└─ 检查 Chrome 是否已运行,若无则启动
↓
Phase 2: 多源抓取
└─ 依次访问20+网站,获取文章标题和链接
↓
Phase 3: 内容过滤
└─ 过滤保留 AI/算力/GPU 相关内容
↓
Phase 4: 摘要提取
└─ 打开每篇文章,获取内容摘要(仅处理前15条)
↓
Phase 5: 整理输出
└─ 分类、去重、生成简报
用户: "最新AI资讯"
AI: [自动执行以下操作]
如遇问题,请检查: