← 返回 Skills 市场
liuboacean

Zhihu Automation Skill

作者 liuboacean · GitHub ↗ · v2.0.7 · MIT-0
cross-platform ⚠ suspicious
96
总下载
0
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install zhihu-auto-skill
功能描述
知乎内容辅助工具。支持查看文章、搜索问题、提取热榜/用户数据。 提供浏览器操作辅助,Cookie 加密存储。
使用说明 (SKILL.md)

知乎内容辅助工具 (Zhihu Helper v2.0)

辅助查看知乎内容,提取数据,Cookie 加密存储,稳定可靠。


触发词(Trigger Phrases)

  • "帮我发一篇知乎文章" / "写知乎文章"
  • "发布知乎想法" / "发一条想法"
  • "回答知乎问题" / "写回答"
  • "知乎提问" / "问一个问题"
  • "点赞" / "评论" / "关注"(知乎内容)
  • "查看知乎热榜" / "知乎热搜"
  • "搜索知乎" / "查一下知乎上的"
  • "知乎数据" / "提取知乎信息"

快速开始

1. 安装依赖

# 依赖已安装,如首次使用:
cd zhihu-skill
npm install
npx playwright install chromium

2. 配置 Cookie 加密密钥

export ZHIHU_COOKIE_KEY="$(openssl rand -hex 32)"

3. 导出知乎 Cookie

# 会自动打开浏览器,手动登录后 Cookie 自动加密保存
node scripts/zhihu-export-cookie.js

4. 验证

# 检查 Cookie 是否有效
node tests/cookie-check.js

功能模块

1️⃣ 发布文章

在知乎专栏发布 Markdown 文章。

你: 帮我发一篇知乎文章,标题是"xxx",内容是...
AI: 正在生成内容 → 展示预览 → 等待用户确认 → 发布 → 返回链接

⚠️ 重要:所有发布操作前 AI 必须展示预览并等待用户明确确认("确认发布?"),未经确认不得执行任何公开操作。

CLI:

# 直接指定内容
node scripts/zhihu-publish.js article --title "标题" --content "正文"

# 从文件读取内容
node scripts/zhihu-publish.js article --title "标题" --content-file "文章.md"

# 保存为草稿(不发布)
node scripts/zhihu-publish.js article --title "标题" --content "正文" --draft

2️⃣ 发布想法

类似 Twitter 的短内容发布。

你: 发一条知乎想法,内容是xxx

CLI:

node scripts/zhihu-publish.js thought --content "想法内容"

# 带图片
node scripts/zhihu-publish.js thought --content "想法内容" --image "图片路径"

3️⃣ 回答问题

搜索问题并撰写回答。

你: 帮我在知乎搜索关于xxx的问题并回答
AI: 搜索问题 → 列出选项 → 用户选择 → 撰写 → 展示预览 → 等待确认 → 提交

CLI:

node scripts/zhihu-answer.js --question-id 123456789 --content "回答内容"

4️⃣ 提问

在知乎上提出新问题。

你: 帮我在知乎提问:xxx
AI: 展示预览 → 等待确认 → 提交

CLI:

node scripts/zhihu-ask.js --title "问题标题" --detail "补充说明"

5️⃣ 互动

点赞、评论、关注(执行前需用户确认)。

你: 给这篇知乎文章点赞 / 评论 / 关注这个用户
AI: 展示操作详情 → 等待确认 → 执行

⚠️ 所有互动操作(点赞/评论/关注)前必须等待用户明确确认。

CLI:

# 点赞
node scripts/zhihu-interact.js like --url "https://www.zhihu.com/question/xxx/answer/xxx"

# 取消点赞
node scripts/zhihu-interact.js unlike --url "..."

# 评论
node scripts/zhihu-interact.js comment --url "..." --content "评论内容"

# 关注用户
node scripts/zhihu-interact.js follow --user "用户ID"

6️⃣ 数据提取

从知乎提取结构化数据。

你: 今天知乎热榜是什么?
AI: 返回热榜 Top 20

CLI:

# 热榜
node scripts/zhihu-extract.js --type hot-list [--limit 20]

# 搜索
node scripts/zhihu-extract.js --type search --query "关键词" [--limit 10]

# 文章详情
node scripts/zhihu-extract.js --type article --id "文章ID"

# 用户信息
node scripts/zhihu-extract.js --type user --id "用户ID"

# 问题详情
node scripts/zhihu-extract.js --type question --id "问题ID"

# 回答列表
node scripts/zhihu-extract.js --type answers --id "问题ID" [--limit 10]

架构

                   AI Agent(用户自然语言触发)
                           │
                  ┌────────▼────────┐
                  │  Skill 调度层    │
                  │  SKILL.md → 路由  │
                  └────────┬────────┘
                           │
              ┌────────────┼────────────┐
              │                         │
    ┌─────────▼─────────┐    ┌─────▼─────────┐
    │  浏览器操作通道   │    │ Python/OpenAPI │
    │  zhihu-browser.js │    │ zhihu_bot.py  │
    │  zhihu-publish.js │    │ zhihu-bridge   │
    │  zhihu-interact.js│    └───────────────┘
    │  zhihu-answer.js   │
    │  zhihu-extract.js │
    └───────────────────┘

注:所有操作统一通过浏览器实现,Cookie 加密存储,稳定可靠。

安全

  • Cookie 使用 AES-256-GCM 加密存储(权限 0600)
  • 环境变量 ZHIHU_COOKIE_KEY 管理加密密钥
  • 支持密钥轮换(rotateCookieKey

Cookie 加密格式

~/.hermes/credentials/zhihu-cookies.enc
├── [12 bytes: 随机 IV]
├── [16 bytes: GCM 认证标签]
└── [AES-256-GCM 加密的 Cookie 数据]

环境变量

变量 必填 说明
ZHIHU_COOKIE_KEY Cookie 加密密钥(openssl rand -hex 32 生成)
ZHIHU_APP_KEY 知乎 OpenAPI app_key(圈子互动)
ZHIHU_APP_SECRET 知乎 OpenAPI app_secret

测试

# 选择器冒烟测试
node tests/smoke-test.js

# Cookie 到期检测
node tests/cookie-check.js

# 端到端集成测试(沙箱模式)
ZHIHU_TEST_MODE=sandbox node tests/e2e-test.js

注意事项

  • ⚠️ 频率控制:HTTP 200-500ms 间隔,浏览器 5-10s 间隔
  • ⚠️ Cookie 有效期:约 30 天,到期需重新登录导出
  • ⚠️ 知乎改版config/selectors.json 可能需更新
  • ⚠️ 签名失效自动降级:C3b 失败自动切换 Plan B(浏览器通道)
  • ⚠️ 浏览器崩溃恢复:withCrashRecovery 自动重建会话
安全使用建议
Only install this if you are comfortable giving it persistent logged-in access to your Zhihu account. Use a test account or sandbox mode first, protect the `.env` file and `ZHIHU_COOKIE_KEY`, and require the agent to show the exact post/comment/follow action for explicit approval before anything is published or changed.
能力标签
cryptorequires-sensitive-credentials
能力评估
Purpose & Capability
The SKILL.md and README describe publishing articles/thoughts, answering questions, asking questions, liking, commenting, and following, which are public account actions. These are coherent with an automation skill, but they exceed the registry description focused on viewing/searching/extraction.
Instruction Scope
SKILL.md instructs the agent to preview and wait for explicit confirmation before public actions, but at least one provided script submits an answer directly once called, so confirmation appears to rely on the agent workflow rather than a hard tool-level guard.
Install Mechanism
There is no registry install spec, but the project includes npm/Playwright setup commands and a setup script that runs local shell commands. This is expected for Playwright automation, but users should run setup deliberately.
Credentials
The registry says there are no required environment variables or primary credentials, while the skill requires a sensitive cookie encryption key and stores Zhihu cookies for logged-in browser automation.
Persistence & Privilege
The skill persistently stores encrypted Zhihu cookies and generates/stores a local cookie key. This is disclosed and purpose-aligned, but it gives the skill ongoing account-level authority and the setup script prints the generated key to the console.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install zhihu-auto-skill
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /zhihu-auto-skill 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v2.0.7
zhihu-auto-skill v2.0.7 - 重命名技能为“知乎内容辅助工具”(zhihu-helper),聚焦内容查看和数据提取。 - 简化和重构功能模块,仅保留文章发布、想法发布、问题回答、提问、互动、数据提取等主流程。 - 明确所有发布/互动类操作必须在执行前用户确认,提升安全性。 - 移除大量废弃脚本,合并/精简原有代码,新增日志和初始化支持。 - 保持 Cookie 加密安全方案和环境配置不变,增加操作稳定性与一致性。 - 完善文档,更突出触发词、主要用法与注意事项。
v2.0.3
zhihu-automation v2.0.3 — 全新双通道知乎自动化 Skill - 支持知乎专栏发文、想法发布、问题提问、回答、点赞、评论、关注等常用操作 - 热榜、搜索、用户、问题等数据可结构化提取,支持多种查询方式 - Playwright 浏览器自动化与 HTTP API 双通道混合架构,兼容性强,执行更稳定 - Cookie 加密存储(AES-256-GCM)与密钥轮换,提升账号安全性 - 丰富 CLI 工具链及详细使用文档,适合开发和自动化场景 - 加强异常恢复和频率控制,自动应对知乎页面结构变动及接口限流
元数据
Slug zhihu-auto-skill
版本 2.0.7
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 2
常见问题

Zhihu Automation Skill 是什么?

知乎内容辅助工具。支持查看文章、搜索问题、提取热榜/用户数据。 提供浏览器操作辅助,Cookie 加密存储。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 96 次。

如何安装 Zhihu Automation Skill?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install zhihu-auto-skill」即可一键安装,无需额外配置。

Zhihu Automation Skill 是免费的吗?

是的,Zhihu Automation Skill 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Zhihu Automation Skill 支持哪些平台?

Zhihu Automation Skill 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Zhihu Automation Skill?

由 liuboacean(@liuboacean)开发并维护,当前版本 v2.0.7。

💬 留言讨论