Skip to content
Back to skills

Zhihu

ASecurity

Read and publish on Zhihu (知乎) with the user's own login cookies (BYOC) — list their published articles with vote/comment stats, inspect one article, and publish a new article. Use when the user mentions 知乎 / Zhihu, "我的知乎文章", reading their article stats (点赞/评论), or publishing/发文 to Zhihu.

  • 225 stars
  • 0 votes
  • 4 copies
  • 10 views
  • Added September 4, 2026
toolspythongobashapi

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 13 files and shows the line behind each finding

Scanned September 4, 2026

npx -y skills add NeverSight/skills_feed --skill zhihu --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Zhihu?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Zhihu
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/neversight-zhihu/badge)](https://www.skillsdirectory.com/skills/neversight-zhihu)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: zhihu
description: Read and publish on Zhihu (知乎) with the user's own login cookies (BYOC) — list their published articles with vote/comment stats, inspect one article, and publish a new article. Use when the user mentions 知乎 / Zhihu, "我的知乎文章", reading their article stats (点赞/评论), or publishing/发文 to Zhihu.
when_to_use: |
  Trigger for anything on the user's Zhihu (知乎) account driven by their own
  login cookie: show who they are, list their published articles with
  vote-up / comment counts, look at one article's stats, or publish a new
  article. This acts as the user's real account, so writes are gated behind
  an explicit confirmation.
connections: [zhihu]
allowed_tools: [Bash]
license: Apache-2.0
metadata:
  author: acedatacloud
  version: "1.1"
---

# zhihu — read & publish on Zhihu via your own cookies

Drives the user's **real** Zhihu account through the same web APIs the site's
own editor uses, authenticated by the login cookie they captured with the ACE
extension. No browser, no third-party deps — just `urllib`.

The connector injects the cookie jar as an env var:

- `ZHIHU_COOKIES` — a JSON array of `{name, value, domain, path, ...}` cookies.
  **Secret — never echo or print it.** The CLI reads it for you.

## CLI

The skill ships [`scripts/blog.py`](scripts/blog.py) — self-contained, stdlib only.

```sh
BLOG=$SKILL_DIR/scripts/blog.py

# Read (run directly)
python3 $BLOG whoami                       # who is logged in
python3 $BLOG articles --limit 20          # my published articles + stats
python3 $BLOG article <article-id>         # one article's details + stats
```

## Verify the connection first

```sh
python3 $BLOG whoami
# → {"id": "...", "name": "崔庆才丨静觅", "url_token": "cui-qing-cai", ...}
```

On a `401`/`403` the cookie is expired — tell the user to reconnect at
<https://auth.acedata.cloud/user/connections> (re-capture with the ACE
extension). Do **not** retry in a loop.

## Reading recipes

| Goal | Command |
|---|---|
| Who am I | `python3 $BLOG whoami` |
| My latest articles + vote/comment counts | `python3 $BLOG articles --limit 20` |
| Next page | `python3 $BLOG articles --limit 20 --offset 20` |
| One article's stats | `python3 $BLOG article <id>` |

Stats come straight from Zhihu: `voteup_count` (赞同), `comment_count` (评论).
Zhihu does not expose per-article read counts on these endpoints.

## Publishing — GATED (dry-run unless trailing `--confirm`)

`publish` writes to the user's real account. Without a trailing `--confirm` it
**dry-runs** (prints what it would do, changes nothing). `--confirm` is honored
**only as the last argument**, so a title/content containing "--confirm" can
never silently go live. Always show the dry-run to the user, get an explicit
"yes", then re-run with `--confirm` last.

```sh
# Content is HTML. For Markdown, convert to HTML first (e.g. `pandoc -f gfm -t html`).
python3 $BLOG publish --title "标题" --content-file article.html               # dry-run
python3 $BLOG publish --title "标题" --content-file article.html --draft-only --confirm  # save a private draft
python3 $BLOG publish --title "标题" --content-file article.html --confirm     # PUBLIC, goes live
```

- `--draft-only` stops after saving a private draft (safe — nothing public).
- Without `--draft-only`, the article is **published publicly** under the user's
  name. Default to `--draft-only` unless the user clearly asked to go live.
- **Images are auto-hosted.** Zhihu strips any `<img>` whose `src` is not on its
  own CDN, so on `--confirm` the CLI re-uploads every external image (HTML
  `<img src>` **and** Markdown `![](url)`, plus `data:` URIs) to Zhihu's image
  service and rewrites the URLs first — images already on `*.zhimg.com` are left
  untouched. The result reports `images: {found, rehosted, failed}`; the dry-run
  reports `images_found`. Pass `--no-images` to skip this. So you can hand the
  CLI HTML/Markdown with normal public image URLs and the pictures survive.

## Gotchas — surface before the user is surprised

- **This is the user's real Zhihu account.** Confirm before any publish; reading
  exposes their own private drafts.
- **Cookie expiry**: Zhihu cookies are short-lived. A `401`/`403` means
  reconnect at auth.acedata.cloud/user/connections — never loop-retry.
- **ToS**: cookie automation is against most platforms' terms. This only ever
  acts on the user's own account with their own captured cookie; the user owns
  that risk. Never use it to scrape other people's content at scale.
- **Never print `ZHIHU_COOKIES`** — it is full account access.
- **Scope**: Zhihu only. Other Chinese platforms (掘金 / CSDN / …) ship as their
  own per-platform skills (e.g. `csdn`, `juejin`), each with its own connector —
  not a `--platform` switch here.

Files in this skill

  • SKILL.md4.7 KB
  • description_ar.txt554 B
  • description_cn.txt331 B
  • description_de.txt434 B
  • description_en.txt324 B
  • description_es.txt382 B
  • description_fr.txt407 B
  • description_it.txt356 B
  • description_ja.txt458 B
  • description_ko.txt391 B
  • description_ru.txt636 B
  • description_tw.txt344 B
  • stats.json69 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in tools →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.