CommunityWriting & Editinggithub.com

liuboacean/zhihu-automation-skill

Zhihu automation skill for posting articles/ideas/Q&A/interactions/data extraction, with dual-channel architecture (HTTP read + browser write).

What is zhihu-automation-skill?

This skill provides an automated tool for interacting with Zhihu, the Chinese knowledge-sharing platform. It leverages a dual-channel architecture: an HTTP-based channel for fast, lightweight read operations (such as browsing timelines, fetching articles, and collecting data) and a browser-based channel for more complex write operations that require browser simulation (such as posting articles, ideas, Q&A replies, and performing interactions like following or liking). By combining these two channels, the skill offers a comprehensive, reliable, and efficient way to automate Zhihu tasks, from content publishing and social engagement to structured data extraction. It is particularly useful for developers, content creators, and researchers who need to manage Zhihu activities programmatically or at scale, supporting platforms like Claude Code, Cursor, and similar AI agent environments through clearly defined tool interfaces.

Works with~Claude Code~Codex CLI~Cursor
npx skills add liuboacean/zhihu-automation-skill

Installed? Explore more Writing & Editing skills: steipete/notion, langchain-ai/langchain, bytedance/podcast-generation · View all 6 →

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

What does zhihu-automation-skill do?

Zhihu automation tool — post articles/ideas/Q&A/interactions/data extraction, dual-channel architecture (HTTP read + browser write).

This skill provides Zhihu automation capabilities using a dual-channel approach:

  • HTTP channel: Fast read operations (timelines, articles, search, data extraction).
  • Browser channel: Comprehensive write operations (posting articles, ideas, replies, interactions).

Features

  • Post articles, ideas, and answers to Zhihu.
  • Interact: follow, like, collect, and comment.
  • Extract structured data from Zhihu pages using HTTP requests.
  • Dual-channel architecture ensures reliability and performance.
  • Supports both single and batch operations.

Tool Interfaces

1. publish_article

  • Publishes a new article on Zhihu.
  • Input: title, content
  • Output: article URL, status

2. publish_idea

  • Publishes a new idea (short post) on Zhihu.
  • Input: content, image URL (optional)
  • Output: idea URL, status

3. reply_question

  • Posts an answer to a Zhihu question.
  • Input: question ID, content
  • Output: answer URL, status

4. follow_user

  • Follows a specified Zhihu user.
  • Input: user ID
  • Output: follow status

5. like_content

  • Likes a specified Zhihu content item (article/answer/idea).
  • Input: content ID, content type
  • Output: like status

6. collect_content

  • Collects a specified Zhihu content item into a collection.
  • Input: content ID, collection ID
  • Output: collect status

7. comment_on_content

  • Comments on a specified Zhihu content item.
  • Input: content ID, content type, comment text
  • Output: comment status

8. extract_zhihu_data

  • Extracts structured data from a Zhihu page (e.g., article content, timeline, search results).
  • Input: URL or query, optional filters
  • Output: JSON data

9. batch_interact

  • Performs batch interactions (e.g., follow multiple users, like multiple items).
  • Input: list of interaction tasks
  • Output: batch status

Requirements

  • Internet connection.
  • Zhihu account login (for browser-based operations).
  • Dependencies: requests, beautifulsoup4, playwright (or similar browser automation library).

Usage Notes

  • The HTTP channel is preferred for read operations due to speed.
  • The browser channel is required for write operations that need user authentication.
  • Ensure your environment has a compatible browser (Chromium recommended) for browser automation.
  • Respect Zhihu's rate limits and terms of service.

Configuration

  • Set environment variables for credentials (optional, required for authenticated operations).
  • ZHIHU_COOKIES: Cookies for HTTP channel authentication.
  • ZHIHU_BROWSER_SESSION: Browser session configuration.

Example (Conceptual)

# Publish an article
publish_article(
    title="How to automate Zhihu with AI",
    content="This is a sample article body..."
)

# Extract data from a Zhihu page
data = extract_zhihu_data(
    url="https://www.zhihu.com/question/123456789"
)

License

MIT

Related Skills