← 返回 Skills 市场
m-lemon

知乎发帖-谷歌浏览器

作者 M-Lemon · GitHub ↗ · v0.0.2 · MIT-0
linux ✓ 安全检测通过
72
总下载
0
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install zhihu-publish-attach
功能描述
Publish Zhihu column articles on Linux via Chrome remote debugging (VNC login). After setup, use exec with zhihu_publish.sh and --title/--body-file. Triggers...
使用说明 (SKILL.md)

Zhihu publish (Chrome attach / Linux VNC)

This skill is self-contained: everything runs from {baseDir}/scripts/. No other repository files are required.

Publish column articles (专栏) by attaching to Chrome on 127.0.0.1:9222 after the user logged in via VNC.

Uses exec + bash {baseDir}/scripts/zhihu_publish.sh — not Browser Relay (see ClawHub zhihu-post for Windows).

First-time setup (after ClawHub install)

Run once on the Linux server:

bash {baseDir}/scripts/setup.sh
bash {baseDir}/scripts/install_chromedriver.sh
bash {baseDir}/scripts/start_chrome_debug.sh

In VNC: log in to Zhihu in that Chrome window.

Verify:

bash {baseDir}/scripts/zhihu_publish.sh --check --json

Expect: "ok": true, "logged_in": true.

Details: {baseDir}/references/linux-vnc-setup.md

When to use

  • Linux server + VNC, Chrome started with debug port 9222
  • Zhihu already logged in (or user can log in after start_chrome_debug.sh)
  • User wants to publish with title + body

Scripts in {baseDir}/scripts/

Script Purpose
setup.sh pip install selenium + chmod (after skill install)
install_chromedriver.sh Install chromedriver (once)
start_chrome_debug.sh Start Chrome (VNC window)
ensure_chrome_debug.sh Restart Chrome if closed (keeps login profile)
zhihu_publish.sh Agent entry — always use this
zhihu_attach_standalone.py Called by zhihu_publish.sh

Title and body (parameters)

Parameter How
--title "..." Required
--body-file /path Preferred for long text — write file first, then pass path
--body "..." Short text only
--publish Open editor and fill
--submit Click 发布 (real post; omit for dry-run)
--json JSON result for the agent
--no-ensure-chrome Skip auto-start (only if Chrome is already running)

Auto-start: Every zhihu_publish.sh run automatically calls ensure_chrome_debug.sh first. If the user closed the browser, Chrome restarts in the background with the same profile (~/.chrome-zhihu-automation) — login usually persists. No need to pass a separate flag unless debugging.

Never put user content inside one shell string. Use separate exec args or --body-file.

Agent workflow

0. Check login (Chrome auto-starts if closed)

bash {baseDir}/scripts/zhihu_publish.sh --check --json

1. Dry-run (fill draft, do not publish)

Write body to e.g. /tmp/zhihu_body.txt, then:

bash {baseDir}/scripts/zhihu_publish.sh \
  --publish \
  --title "USER_TITLE" \
  --body-file /tmp/zhihu_body.txt \
  --json

Confirm with user (VNC or chat). JSON has dry_run: true without --submit.

2. Real publish (only after user confirms)

bash {baseDir}/scripts/zhihu_publish.sh \
  --publish \
  --title "USER_TITLE" \
  --body-file /tmp/zhihu_body.txt \
  --submit \
  --json

Success: "ok": true, "submitted": true.

Exec examples

command: bash
args: ["{baseDir}/scripts/zhihu_publish.sh", "--check", "--json"]
command: bash
args: [
  "{baseDir}/scripts/zhihu_publish.sh",
  "--publish",
  "--title", "\x3Ctitle>",
  "--body-file", "/tmp/zhihu_post_body.txt",
  "--submit",
  "--json"
]

Chromedriver (version must match Chrome)

Selenium attach requires chromedriver even when Chrome is already running.
Install to /usr/local/bin/chromedriver (or set CHROMEDRIVER_PATH).

bash {baseDir}/scripts/install_chromedriver.sh
bash {baseDir}/scripts/verify_chrome_stack.sh

If you installed Chrome via dnf RPM (e.g. 148.0.7778.215), chromedriver must be the same build from Chrome for Testing — see {baseDir}/references/linux-vnc-setup.md.

Troubleshooting

Symptom Action
chromedriver not in PATH install_chromedriver.sh or export CHROMEDRIVER_PATH=/usr/local/bin/chromedriver
Version mismatch verify_chrome_stack.sh; re-download driver for your google-chrome-stable --version
Cannot connect to 9222 Usually auto-fixed on next zhihu_publish.sh run; or ensure_chrome_debug.sh
Browser closed Auto-restart on publish; re-login in VNC only if --check returns 401
Chrome starts but no window on VNC Set DISPLAY for the OpenClaw/exec user (e.g. export DISPLAY=:1)
No selenium module bash {baseDir}/scripts/setup.sh
API 401 Re-login in VNC

Safety

  • Without --submit = draft only.
  • Use --submit only when the user explicitly asks to publish.
  • Wait ≥ 3 minutes between posts if publishing repeatedly.
安全使用建议
Install this only if you want an agent to control a dedicated logged-in Chrome profile for Zhihu posting. Review the setup commands before running sudo or downloading ChromeDriver, keep the remote debugging port local, use dry-run mode first, and only allow --submit when you are ready for a real public post.
能力标签
crypto
能力评估
Purpose & Capability
The scripts and documentation consistently match the stated purpose: start or attach to local Chrome, verify Zhihu login, fill a column article draft, and publish only when the submit flag is used.
Instruction Scope
The trigger phrases are somewhat broad for a skill that can interact with a logged-in public account, but the runtime instructions distinguish dry-run drafting from real publishing and require explicit use of --submit for posting.
Install Mechanism
Setup installs Selenium and may download/install ChromeDriver or advise sudo system package commands; these are expected for Selenium-based browser automation, but users should verify sources and understand the host changes.
Credentials
Linux, VNC, Chrome remote debugging on 127.0.0.1, network access to Zhihu and Google ChromeDriver sources, and reading a body file are proportionate to the publishing workflow and are documented.
Persistence & Privilege
The skill keeps a dedicated Chrome profile at ~/.chrome-zhihu-automation and can start Chrome in the background so login persists; this is disclosed and bounded to the automation profile, with no cron or broader persistence found.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install zhihu-publish-attach
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /zhihu-publish-attach 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.0.2
- Added scripts/verify_chrome_stack.sh for checking Chrome and chromedriver versions. - Updated documentation to reflect improved auto-start behavior and troubleshooting steps. - Clarified chromedriver requirements and provided verification instructions. - Minor edits to parameter explanations and troubleshooting table for clarity.
v0.0.1
Initial release — publish Zhihu column articles via Chrome remote debugging on Linux VNC. - Publishes Zhihu 专栏 articles using local Chrome on port 9222 after VNC login. - Provides bash scripts for setup, Chrome launch, and attachment. - Supports draft and publish modes with clear distinction (`--submit` for real publishing). - Accepts title and body (recommended via file) as parameters; outputs results in JSON. - Includes troubleshooting steps and safe usage guidelines. - Designed for Linux, with dependencies on python3, curl, and unzip.
元数据
Slug zhihu-publish-attach
版本 0.0.2
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 2
常见问题

知乎发帖-谷歌浏览器 是什么?

Publish Zhihu column articles on Linux via Chrome remote debugging (VNC login). After setup, use exec with zhihu_publish.sh and --title/--body-file. Triggers... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 72 次。

如何安装 知乎发帖-谷歌浏览器?

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

知乎发帖-谷歌浏览器 是免费的吗?

是的,知乎发帖-谷歌浏览器 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

知乎发帖-谷歌浏览器 支持哪些平台?

知乎发帖-谷歌浏览器 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(linux)。

谁开发了 知乎发帖-谷歌浏览器?

由 M-Lemon(@m-lemon)开发并维护,当前版本 v0.0.2。

💬 留言讨论