← Back to Skills Marketplace
168
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install aibase-news-get
Description
从AI新闻网站爬取最新资讯,支持自动生成新闻总结。用于AI新闻采集、内容聚合、舆情监控。
README (SKILL.md)
新闻爬取 Skill
概述
本技能用于从AI新闻网站爬取最新资讯,并生成格式化新闻简报。支持多网站扩展,具备去重功能。
目录结构
news-scraper/
├── SKILL.md # 主技能说明
├── config.py # 配置文件
├── scrapers/
│ ├── __init__.py
│ ├── base.py # 爬虫基类
│ └── aibase.py # AI Base网站爬虫
├── scripts/
│ └── crawl.py # 主爬取入口
└── templates/
└── news_template.md # 新闻模板
快速开始
1. 安装依赖
pip install requests beautifulsoup4 openpyxl
2. 运行爬虫
# 爬取AI Base新闻(默认20条)
python scripts/crawl.py --site aibase
# 限制爬取数量
python scripts/crawl.py --site aibase --limit 10
编程调用
import sys
sys.path.insert(0, "~/.qoder/skills/news-scraper")
from scripts.crawl import crawl_and_return_json
# 爬取新闻,返回JSON数据
result = crawl_and_return_json(site="aibase", limit=20)
news_list = result["news"] # 获取新闻列表
配置说明
编辑 config.py:
MAX_NEWS_PER_CRAWL: 每次爬取最大数量(默认20)NEWS_JSON_FILENAME: JSON文件名(默认news_latest.json)
保存目录由AI根据实际环境自行决定,默认保存在当前目录下的News文件夹。
输出文件
| 文件 | 说明 |
|---|---|
news_latest.json |
JSON格式,主数据文件 |
JSON结构:
{
"crawl_time": "2026-03-17T10:33:27",
"total_count": 20,
"news": [
{
"title": "新闻标题",
"url": "https://...",
"publish_time": "2026-03-17 02:00:00",
"source": "AIBase",
"keywords": [],
"summary": "一句话总结",
"content": "正文内容"
}
]
}
爬取逻辑
执行流程
- 检查目录 - 自动检测并创建保存目录
- 加载配置 - 读取config.py中的网站配置
- 获取新闻列表 - 每个网站最多获取指定数量新闻
- 去重检查 - 与已有新闻比对URL,剔除重复
- 提取正文 - 访问每条新闻详情页提取中文内容
- 保存文件 - 更新JSON文件,生成Markdown文件
去重逻辑
- 基于
url字段进行比对 - 检查保存目录下所有已有markdown文件的URL
- 发现重复URL则跳过该条新闻
爬取顺序
从新到旧(按发布时间倒序)
添加新网站
- 在
scrapers/目录下创建新的爬虫文件 - 继承
BaseScraper类 - 实现必要方法
- 在
config.py的SITES字典中注册
命令行选项
| 参数 | 说明 | 默认值 |
|---|---|---|
--site |
网站标识符 | aibase |
--limit |
爬取数量 | 20 |
--force |
强制覆盖已存在文件 | false |
部署说明
本skill会自动选择合适的目录保存文件,AI会根据当前环境自行决定存储位置。
Usage Guidance
这是一个本地新闻爬虫,行为与其描述基本一致. 在安装/运行前请注意:
- 它会访问网络并向目标站点(默认 https://www.aibase.com)发出 HTTP 请求;请确认你有权抓取这些页面并遵守目标站点的 robots.txt/使用条款。
- 脚本会在运行目录下创建一个 News 文件夹并写入 news_latest.json 和若干 Markdown 文件;如果你希望保存到其它位置,请在调用 crawl_and_return_json 时传入 news_dir 或先修改代码。
- 文档与代码有小不一致(例如文档提到 ~/Documents/News,但代码默认 Path.cwd()/"News";文档暗示会生成 AI 摘要,但代码不调用任何外部模型或 API——摘要部分需要由平台/代理或手动步骤完成)。
- 建议在受限环境或虚拟环境中安装依赖并运行(使用 virtualenv),避免以高权限用户执行。若你担心网络或磁盘写入,可先在隔离环境(例如容器)中运行并审阅输出文件。
Capability Analysis
Type: OpenClaw Skill
Name: aibase-news-get
Version: 1.0.0
The skill bundle is a standard web scraper designed to collect AI-related news from aibase.com. It uses the requests and BeautifulSoup libraries to fetch and parse news articles, saving the results locally in JSON and Markdown formats. The code follows its stated purpose without any evidence of data exfiltration, malicious execution, or harmful prompt injection instructions.
Capability Assessment
Purpose & Capability
技能名与描述(爬取 AI 新闻并生成摘要)与代码实现大体一致:包含爬虫基类、AIBase 专用解析器和主运行脚本,使用 requests/BeautifulSoup 抓取并保存 JSON/Markdown。没有请求与任务无关的凭据或系统权限。
Instruction Scope
SKILL.md 指示安装 requests/beautifulsoup4/openpyxl 并运行 scripts/crawl.py;代码会访问新闻网站、解析页面、基于 URL 去重并在本地保存 JSON/Markdown。需要注意的点:SKILL.md 与代码存在小不一致(如说明中提到的保存路径 ~/Documents/News 与代码实际使用的 Path.cwd()/"News"不一致;模板目录在文档中提到但仓库里不存在;文档多次暗示“生成 AI 摘要”,但代码本身并不调用任何模型或外部 AI API——而是把 JSON 返回供外部模型(例如 agent)生成摘要)。这些是实现或文档差异,但并不表示越权的数据访问。
Install Mechanism
注册表中没有 install spec(instruction-only),文件直接随技能打包提供。依赖来自 PyPI(requests, beautifulsoup4, openpyxl)——这是正常且可追踪的。没有下载不明 URL 或执行远端二进制的行为。
Credentials
技能未请求任何环境变量、凭据或特殊配置路径。保存和读取仅限于用户可控的本地目录(News 文件夹),且仅用于去重和输出。没有发现需要外部 API key 或系统凭据的要求。
Persistence & Privilege
技能不会设置 always:true,默认可被代理自主调用(平台默认)。它会在运行时创建/写入本地目录(News)并读取该目录下的 Markdown 文件用于去重——这是功能所需但意味着技能会在磁盘上长期保存数据。用户应注意保存位置与访问权限。
How to Use
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install aibase-news-get - After installation, invoke the skill by name or use
/aibase-news-get - Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
自用
Metadata
Frequently Asked Questions
What is AIBase-News-Get?
从AI新闻网站爬取最新资讯,支持自动生成新闻总结。用于AI新闻采集、内容聚合、舆情监控。 It is an AI Agent Skill for Claude Code / OpenClaw, with 168 downloads so far.
How do I install AIBase-News-Get?
Run "/install aibase-news-get" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is AIBase-News-Get free?
Yes, AIBase-News-Get is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does AIBase-News-Get support?
AIBase-News-Get is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created AIBase-News-Get?
It is built and maintained by BAI (@jiahuishao); the current version is v1.0.0.
More Skills