zhihu-helper
知乎内容辅助工具。支持查看文章、搜索问题、提取热榜/用户数据。 提供浏览器操作辅助,Cookie 加密存储。 Skill: zhihu-helper Owner: liuboacean Summary: 知乎内容辅助工具。支持查看文章、搜索问题、提取热榜/用户数据。 提供浏览器操作辅助,Cookie 加密存储。 Tags: latest:2.0.7 Version history: v2.0.7 | 2026-05-15T06:36:17.772Z | auto zhihu-auto-skill v2.0.7 - 重命名技能为“知乎内容辅助工具”(zhihu-helper),聚焦内容查看和数据提取。 - 简化和重构功能模块,仅保留文章发布、想法发布、问题回答、提问、互动、数据提取等主流程。 - 明确所有发布/互动类操作必须在执行前用户确认,提升安全性。 - 移除大量废弃脚本,合并/精简原有代码,新增日志和初始化支持。 - 保持 Cookie 加密安全方案和环境配置不变,增加操作稳定性与一致性。 - 完善文档,更突出触发词、主要用法与注意
Rank
62
Safety
84
Downloads
1.0k
Updated
Oct 11, 2026
Version
2.0.7
Source
CLAWHUB
About
What it does, and when to use it.
Capability contract not published. No trust telemetry is available yet. 1K downloads reported by the source. Last updated 10/11/2026.
Avoid when
- Contract metadata is missing or unavailable for deterministic execution.
Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing
Public facts
Every fact links back to the source it came from.
- Vendor
- Clawhubvendor · observed Oct 11, 2026
- Protocol compatibility
- OpenClawcompatibility · observed Oct 11, 2026
- Adoption signal
- 1K downloadsadoption · observed Oct 11, 2026
- Latest release
- 2.0.7release · observed May 15, 2026
- Handshake status
- UNKNOWNsecurity
Install and run
Setup complexity: low.
clawhub skill install s1779brgcyhkdmz9tgjpwarx3h84vb82:zhihu-auto-skill- Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.
- Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.
Contract: missing
curl -s "https://www.xpersona.co/api/v1/agents/clawhub-liuboacean-zhihu-auto-skill/snapshot"
Run-check
$0.02 USD1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.
Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.
Documentation
CLAWHUB
81,569 characters of source documentation, loaded on request.
Extracted files
5 files captured from the source.
SKILL.md
---
name: zhihu-helper
description: >-
知乎内容辅助工具。支持查看文章、搜索问题、提取热榜/用户数据。
提供浏览器操作辅助,Cookie 加密存储。
metadata:
author: Hermes + WorkBuddy
version: "2.0.7"
requires:
- node
- playwright
- python3
env:
- ZHIHU_COOKIE_KEY (sensitive)
- ZHIHU_APP_KEY (optional)
- ZHIHU_APP_SECRET (optional)
---
# 知乎内容辅助工具 (Zhihu Helper v2.0)
辅助查看知乎内容,提取数据,Cookie 加密存储,稳定可靠。
---
## 触发词(Trigger Phrases)
- "帮我发一篇知乎文章" / "写知乎文章"
- "发布知乎想法" / "发一条想法"
- "回答知乎问题" / "写回答"
- "知乎提问" / "问一个问题"
- "点赞" / "评论" / "关注"(知乎内容)
- "查看知乎热榜" / "知乎热搜"
- "搜索知乎" / "查一下知乎上的"
- "知乎数据" / "提取知乎信息"
## 快速开始
### 1. 安装依赖
```bash
# 依赖已安装,如首次使用:
cd zhihu-skill
npm install
npx playwright install chromium
```
### 2. 配置 Cookie 加密密钥
```bash
export ZHIHU_COOKIE_KEY="$(openssl rand -hex 32)"
```
### 3. 导出知乎 Cookie
```bash
# 会自动打开浏览器,手动登录后 Cookie 自动加密保存
node scripts/zhihu-export-cookie.js
```
### 4. 验证
```bash
# 检查 Cookie 是否有效
node tests/cookie-check.js
```
---
## 功能模块
### 1️⃣ 发布文章
在知乎专栏发布 Markdown 文章。
```
你: 帮我发一篇知乎文章,标题是"xxx",内容是...
AI: 正在生成内容 → 展示预览 → 等待用户确认 → 发布 → 返回链接
```
> ⚠️ **重要**:所有发布操作前 AI 必须展示预览并等待用户明确确认("确认发布?"),未经确认不得执行任何公开操作。
**CLI:**
```bash
# 直接指定内容
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:**
```bash
node scripts/zhihu-publish.js thought --content "想法内容"
# 带图片
node scripts/zhihu-publish.js thought --content "想法内容" --image "图片路径"
```
### 3️⃣ 回答问题
搜索问题并撰写回答。
```
你: 帮我在知乎搜索关于xxx的问题并回答
AI: 搜索问题 → 列出选项 → 用户选择 → 撰写 → 展示预览 → 等待确认 → 提交
```
**CLI:**
```bash
node scripts/zhihu-answer.js --question-id 123456789 --content "回答内容"
```
### 4️⃣ 提问
在知乎上提出新问题。
```
你: 帮我在知乎提问:xxx
AI: 展示预览 → 等待确认 → 提交
```
**CLI:**
```bash
node scripts/zhihu-ask.js --title "问题标题" --detail "补充说明"
```
### 5️⃣ 互动
点赞、评论、关注(执行前需用户确认)。
```
你: 给这篇知乎文章点赞 / 评论 / 关注这个用户
AI: 展示操作详情 → 等待确认 → 执行
```
> ⚠️ **所有互动操作(点赞/评论/关注)前必须等待用户明确确认。**
**CLI:**
```bash
# 点赞
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:**
```bash
# 热榜
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(用户自然语言触发)
│
README.md
<div align="center">
# 🤖 知乎操作辅助 Skill
**通过浏览器操作知乎 — 发文章、写想法、回答问题、看热榜**
[](https://github.com/liuboacean/zhihu-automation-skill)
[](LICENSE)
[](https://github.com/liuboacean/zhihu-automation-skill/actions)
[](https://nodejs.org)
[](https://playwright.dev)
[](CONTRIBUTING.md)
</div>
---
## ✨ 它能做什么?
| 功能 | 一句话描述 | 通道 |
|:----|-----------|:----:|
| 📝 **发文章** | Markdown → 一键发布知乎专栏(**25ms 批量粘贴**) | 浏览器 |
| 💭 **发想法** | 像发朋友圈一样发想法 | 浏览器 |
| ❓ **答问题** | 搜索并回答知乎上的问题 | 浏览器 |
| 🙋 **提问** | 在知乎上自动提问 | 浏览器 |
| 👍 **互动** | 点赞、评论、关注一条龙 | 浏览器 |
| 🔥 **看热榜** | 获取知乎热榜 Top 20(浏览器兜底) | 浏览器 |
| 🔍 **搜内容** | 搜索知乎上的文章和回答 | 浏览器 |
| 👁️ **预览模式** | 发布前查看内容并确认(`--preview`) | — |
| 🔒 **沙箱模式** | `ZHIHU_TEST_MODE=sandbox` 保存本地草稿,不实际发布 | — |
> ℹ️ 所有操作统一走**浏览器通道**(Cookie 登录),稳定可靠。
> HTTP 签名通道因 API 签名算法分析成本过高已正式放弃(详见 `zhihu-signature.js`)。
---
## 🚀 30 秒上手
```bash
# 1. 装依赖(已装好可跳过)
cd zhihu-skill && npm install
# 2. 一键配置(生成密钥 + 安装浏览器 + 引导登录)
npm run setup
# 3. 开玩 🎉
node zhihu.js hot-list --limit 5 # 看热榜
node zhihu.js publish thought --content "Hello 知乎" # 发想法
node zhihu.js publish article --title "标题" --content "正文" # 发文章
```
> 💡 **小贴士**:`npm run setup` 会自动生成加密密钥并写入 `.env`,引导你手动登录知乎保存 Cookie。密钥只存在本地,**永远不要提交到代码仓库**。
---
## 🏗️ 架构
```
┌──────────────────┐
│ AI Agent / 用户 │
└────────┬─────────┘
│
┌────────────────┼────────────────┐
▼ ▼ ▼
┌────────────┐ ┌──────────────┐ ┌────────────┐
│ 浏览器操作 │ │ 编辑器 │ │ Cookie 加密 │
│ 发布/互动/问答│ │ Draft.js 兼容│ │ AES-256-GCM│
│ 热榜/搜索 │ │ 25ms 批量粘贴│ │ 密钥轮换 │
└────────────┘ └──────────────┘ └────────────┘
```
| 特性 | 说明 |
|------|------|
| 🔒 **Cookie 安全** | AES-256-GCM 加密存储,权限 0600,支持密钥轮换 |
| 🛡️ **防护机制** | 贝塞尔鼠标轨迹模拟人工操作 |
| 🔄 **Plan B 降级** | 签名失效自动降级到浏览器通道,永不中断 |
| ⏱️ **智能限流** | 浏览器 5-10s / 限流指数退避(30s → 10min) |
| 💥 **崩溃恢复** | 浏览器崩溃自动重建会话,任务不丢失 |
| ⚡ **极速发布** | ClipboardEvent 批量粘贴,800 字文章 25ms 完成 |
| 📊 **进度反馈** | 发布流程 `[1/5]~[5/5]` 分步进度条 |
| 👁️ **发布预览** | `--preview` 发布前确认内容,防止误操作 |
| 🔒 **沙箱模式** | `ZHIHU_TEST_MODE=sandbox` 仅保存草稿,安全测试 |
| 📋 **统一日志** | DEBUG/INFO/WARN/ERROR 四级,控制台彩色 + JSONL 文件 |
---
## 📖 详细用法
### 统一 CLI(推荐)
```bash
node zhihu.js setup # 首次配置引导
node zhihu.js publish article --title "标题" --content "正文" [--draft] [--preview]
node zhihu.js publish thought --content "想法" [--image "photo.jpg"] [--preview]
node zhihu.js hot-list [--limit 10] # 热榜
node zhihu.js search _meta.json
{
"ownerId": "kn73qbrbqs4s8t2nh8pm22wxbd84vm7r",
"slug": "zhihu-auto-skill",
"version": "2.0.7",
"publishedAt": 1778826977772
}CHANGELOG.md
# 变更日志
## v2.0.0 (2026-05-09)
### 正式发布 — 浏览器操作架构
知乎操作辅助 Skill v2.0 采用浏览器操作架构,统一通过浏览器通道实现所有操作,提升了稳定性。
#### 新架构
```
┌──────────────────┐
│ AI Agent / 用户 │
└────────┬─────────┘
│
┌────────▼─────────┐
│ 浏览器操作通道 │
│ 所有操作统一实现 │
└────────┬─────────┘
│
┌────────────┼────────────┐
│ │
┌─────────▼─────────┐ ┌─────▼─────────┐
│ 浏览器操作 │ │ Python/OpenAPI │
│ zhihu-browser.js│ │ zhihu_bot.py │
│ zhihu-publish.js│ │ zhihu-bridge │
│ zhihu-interact.js│
│ zhihu-extract.js│
└───────────────────┘
```
#### 6 大功能模块
| 模块 | CLI 脚本 | 通道 |
|:----|:---------|:----:|
| 📝 **发布文章** | `zhihu-publish.js article` | 浏览器通道 |
| 💭 **发布想法** | `zhihu-publish.js thought` | 浏览器通道 |
| ❓ **回答问题** | `zhihu-answer.js` | 浏览器通道 |
| 🙋 **提问** | `zhihu-ask.js` | 浏览器通道 |
| 👍 **互动(点赞/评论/关注)** | `zhihu-interact.js` | 浏览器通道 |
| 🔥 **数据提取(热榜/搜索/用户/问题)** | `zhihu-extract.js` | 浏览器通道 |
#### 新增特性
- **浏览器自动化架构**:所有操作统一通过浏览器实现,稳定可靠
- **Cookie AES-256-GCM 加密存储**:加密密钥通过 `ZHIHU_COOKIE_KEY` 环境变量管理,支持密钥轮换
- **人工操作模拟**:贝塞尔鼠标轨迹、逐字输入
- **智能签名引擎(zse-123)**:适配器模式支持多种签名算法,支持 C3b 前向兼容和 WebWorker 计算
- **Plan B 降级策略**:HTTP 签名失败自动降级到浏览器通道
- **崩溃自动恢复**:`withCrashRecovery` 机制自动重建浏览器会话
- **指数退避限流**:遇到限流时自动退避(30s → 1min → 3min → 10min)
- **选择器自动降级**:`config/selectors.json` 支持主/备/兜底三级选择器
- **沙箱测试模式**:`ZHIHU_TEST_MODE=sandbox` 隔离测试环境
#### 12 个核心模块
- `zhihu-core.js` — Cookie 加密/浏览器管理/日志/重试
- `zhihu-signature.js` — 签名生成(适配器模式)
- `zhihu-http.js` — HTTP 读通道
- `zhihu-browser.js` — 浏览器操作
- `zhihu-publish.js` — 发布文章 + 想法
- `zhihu-interact.js` — 点赞 + 评论 + 关注
- `zhihu-answer.js` — 回答问题
- `zhihu-ask.js` — 提问
- `zhihu-extract.js` — 数据提取
- `zhihu-bridge.js` — Python 桥接
- `zhihu-export-cookie.js` — Cookie 导出
- `python/zhihu_bot.py` — OpenAPI 圈子互动
---
## v1.x (历史版本)
v1.x 为单通道架构(纯浏览器操作),代码已不再维护。建议升级到 v2.0 获取更好的性能和稳定性。CONTRIBUTING.md
# 贡献指南 感谢你对知乎自动化 Skill 的关注!我们欢迎任何形式的贡献 —— 新功能、bug 修复、文档改进、使用反馈,通通欢迎。 --- ## 开发环境搭建 ### 前置要求 - Node.js >= 18(推荐使用 nvm 管理版本,参考 `.nvmrc`) - npm(随 Node.js 一同安装) ### 安装步骤 ```bash # 克隆仓库 git clone https://github.com/liuboacean/zhihu-automation-skill.git cd zhihu-automation-skill # 安装依赖 npm install # 安装 Playwright Chromium 浏览器 npx playwright install chromium ``` ### 配置 Cookie 加密密钥 ```bash export ZHIHU_COOKIE_KEY="$(openssl rand -hex 32)" ``` --- ## 代码规范 ### JavaScript 规范 - **ESM 模块**:项目使用 `"type": "module"`,所有 `.js` 文件使用 `import`/`export` 语法 - **命名风格**: - 函数名使用 camelCase - 类名使用 PascalCase - 常量使用 UPPER_SNAKE_CASE - 文件名使用 kebab-case - **异步处理**:优先使用 `async/await`,避免裸 `.then()` / `.catch()` - **错误处理**:关键操作必须包裹 try-catch,错误信息应包含上下文 ### 提交规范 本项目遵循 [Conventional Commits](https://www.conventionalcommits.org/): ``` <type>(<scope>): <description> [optional body] ``` 常用类型: | 类型 | 用途 | | ---------- | -------------------- | | `feat` | 新功能 | | `fix` | Bug 修复 | | `docs` | 文档变更 | | `refactor` | 代码重构 | | `perf` | 性能优化 | | `test` | 测试相关 | | `chore` | 构建/工具/依赖变更 | | `security` | 安全相关修复 | 示例: ``` feat(zhihu-publish): 支持 Markdown 表格转知乎格式 fix(zhihu-interact): 修复点赞后未更新状态 docs(readme): 更新 Cookie 导出步骤 ``` ### Prettier 格式化 建议在编辑器中开启 Prettier 自动格式化,或提交前运行: ```bash npx prettier --check scripts/**/*.js ``` > 注:项目当前尚未配置 `.prettierrc`,欢迎 PR 添加。 --- ## 提交 PR 流程 1. **Fork 本仓库** 到你的 GitHub 账号 2. **创建功能分支**:`git checkout -b feat/your-feature-name` 3. **进行开发**,确保: - 代码风格与现有代码一致 - 为新增功能添加必要的注释和错误处理 - 如果是新脚本,更新 `package.json` 中的 `"scripts"` 字段 4. **运行测试**:`npm test` 5. **提交**:`git commit -m "feat(xxx): 简洁描述变更"` 6. **推送分支**:`git push origin feat/your-feature-name` 7. **创建 PR** 到 `main` 分支,并在描述中说明: - 做了什么、为什么做 - 测试情况 - 截图(如涉及 UI 操作) ### PR 审查标准 - 代码无明显安全问题 - 不引入新的外部依赖(或新增依赖有充分理由) - 新增功能的 CLI 接口风格与现有保持一致 - 浏览器自动化操作包含合适的等待和重试逻辑 - 已考虑知乎反爬限制(频率控制、降级策略等) --- ## 测试 ```bash # 选择器冒烟测试 npm run smoke-test # Cookie 到期检测 npm run cookie-check # 端到端测试(沙箱模式) npm run e2e-test ``` 建议在提交 PR 前至少通过 `smoke-test` 和 `cookie-check`。 --- ## 注意事项 ### Cookie 安全 - Cookie 文件使用 **AES-256-GCM** 加密存储在 `~/.hermes/credentials/zhihu-cookies.enc` - **切勿**将未加密的 Cookie 提交到 Git - **切勿**将 `ZHIHU_COOKIE_KEY` 写在代码或提交信息中 - Cookie 有效期约 30 天,过期需重新登录导出 ### 知乎反爬限制 - **频率控制**:HTTP 请求间隔 200-500ms,浏览器操作间隔 5-10s - **限流处理**:遇到限流时自动指数退避(30s → 1min → 3min → 10min) - **验证码**:浏览器通道可能触发滑块验证,系统会自动等待手动验证 - **选择器失效**:知乎前端经常改版,`config/selectors.json` 可能需更新 - **签名降级**:HTTP 签名通道返回 401 时自动降级到浏览器通道 ### 账号安全建议 - 建议先在**小号**上测试所有功能 - 不要在公共机器上长期保存 Cookie 密钥 - 定期轮换 Cookie 加密密钥 --- ## 问题反馈 遇到问题请先查阅已有 Issues。如未解决,欢迎提交 Issue,请包含: - 操作步骤 - 期望结果与实际结果 - 相关日志或错误信息 - 知乎页面是否已改版(可附上截图) --- 再次感谢你的贡献!
AionUi
Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!
activepieces
AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
cherry-studio
AI productivity studio with smart chat, autonomous agents, and 300+ assistants.
CopilotKit
The Frontend for Agents & Generative UI. React + Angular
Machine-readable data
The same record, as JSON, for agents and crawlers.
{
"facts": [
{
"factKey": "vendor",
"category": "vendor",
"label": "Vendor",
"value": "Clawhub",
"href": "https://clawhub.ai/liuboacean/skills/zhihu-auto-skill",
"sourceUrl": "https://clawhub.ai/liuboacean/skills/zhihu-auto-skill",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-11T18:08:44.640Z",
"isPublic": true
},
{
"factKey": "protocols",
"category": "compatibility",
"label": "Protocol compatibility",
"value": "OpenClaw",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-liuboacean-zhihu-auto-skill/contract",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-liuboacean-zhihu-auto-skill/contract",
"sourceType": "contract",
"confidence": "medium",
"observedAt": "2026-10-11T18:08:44.640Z",
"isPublic": true
},
{
"factKey": "traction",
"category": "adoption",
"label": "Adoption signal",
"value": "1K downloads",
"href": "https://clawhub.ai/liuboacean/zhihu-auto-skill",
"sourceUrl": "https://clawhub.ai/liuboacean/zhihu-auto-skill",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-11T18:08:44.640Z",
"isPublic": true
},
{
"factKey": "latest_release",
"category": "release",
"label": "Latest release",
"value": "2.0.7",
"href": "https://clawhub.ai/liuboacean/zhihu-auto-skill",
"sourceUrl": "https://clawhub.ai/liuboacean/zhihu-auto-skill",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-05-15T06:36:17.772Z",
"isPublic": true
},
{
"factKey": "handshake_status",
"category": "security",
"label": "Handshake status",
"value": "UNKNOWN",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-liuboacean-zhihu-auto-skill/trust",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-liuboacean-zhihu-auto-skill/trust",
"sourceType": "trust",
"confidence": "medium",
"observedAt": null,
"isPublic": true
}
],
"events": [
{
"eventType": "release",
"title": "Release 2.0.7",
"description": "zhihu-auto-skill v2.0.7 - 重命名技能为“知乎内容辅助工具”(zhihu-helper),聚焦内容查看和数据提取。 - 简化和重构功能模块,仅保留文章发布、想法发布、问题回答、提问、互动、数据提取等主流程。 - 明确所有发布/互动类操作必须在执行前用户确认,提升安全性。 - 移除大量废弃脚本,合并/精简原有代码,新增日志和初始化支持。 - 保持 Cookie 加密安全方案和环境配置不变,增加操作稳定性与一致性。 - 完善文档,更突出触发词、主要用法与注意事项。",
"href": "https://clawhub.ai/liuboacean/zhihu-auto-skill",
"sourceUrl": "https://clawhub.ai/liuboacean/zhihu-auto-skill",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-05-15T06:36:17.772Z",
"isPublic": true
}
]
}Record generated Oct 11, 2026.
