整合知乎、今日头条、AIBase三大中文平台的热搜/热门数据。采用「调度器 + 独立脚本」插件式架构,每个平台一个独立 Python 脚本,由统一的 hub.py 调度。
text
news-hot-hub/
├── SKILL.md # 本文件 — AI Agent 技能指令
├── requirements.txt # Python 依赖
├── scripts/ # 可执行脚本
│ ├── hub.py # 统一调度入口 ★
│ ├── zhihu.py # 知乎(已实现)
│ ├── toutiao.py # 今日头条(已实现)
│ └── aibase.py # AIBase(已实现)
└── references/ # 参考文档
├── architecture.md # 架构设计
├── data-schema.md # 数据格式规范
└── platform-guide.md # 平台接入指南
bash
pip install -r ${SKILL_DIR}/requirements.txt
核心依赖: requests, beautifulsoup4, lxml
统一入口: ${SKILL_DIR}/scripts/hub.py
bash
python ${SKILL_DIR}/scripts/hub.py <command> [options]
全称缩写中文zhihu``zh知乎toutiao``tt今日头条aibase``abAIBase
命令说明选项fetch <platform>获取指定平台热榜--limit N``all并行获取全部平台--limit N``compare跨平台热点词频对比--limit N``status检查各平台脚本可用性—
bash
# 单平台获取
python ${SKILL_DIR}/scripts/hub.py fetch zhihu
python ${SKILL_DIR}/scripts/hub.py fetch toutiao --limit 20
python ${SKILL_DIR}/scripts/hub.py fetch aibase
python ${SKILL_DIR}/scripts/hub.py fetch aibase daily
# 多平台
python ${SKILL_DIR}/scripts/hub.py fetch zhihu,toutiao
# 全部平台
python ${SKILL_DIR}/scripts/hub.py all
# 跨平台对比
python ${SKILL_DIR}/scripts/hub.py compare
# 检查可用性
python ${SKILL_DIR}/scripts/hub.py status
Agent 加载本 skill 后,根据用户意图判断调用方式:
fetch <platform>fetch <p1>,<p2> 逗号分隔allcompare用户意图子命令AI新闻fetch aibase(默认 hot-search → news)AI日报fetch aibase dailyAI新闻+日报fetch aibase all
JSON Lines(每行一个平台结果):
json
{"platform": "知乎", "success": true, "data": {"type": "hot_search", "count": 25, "data": [...]}}
跨平台词频分析 JSON,包含 top_keywords 和 per_platform 字段。
详细数据格式见
references/data-schema.md
变量说明HOT_HUB_LIMIT全局默认 limit,CLI --limit 可覆盖
需要深入了解时,按需读取 references/ 目录下的文档:
references/architecture.md:系统架构、数据流、扩展机制references/data-schema.md:各平台 JSON 输出字段详细定义references/platform-guide.md:新平台接入步骤、脚本模板、认证说明需求命令知乎热搜fetch zhihu头条热榜fetch toutiaoAIBase新闻fetch aibaseAI日报fetch aibase daily全部平台all词频对比compare可用性检查status