Skip to content

feat: add 知识星球(zsxq) site adapter#571

Merged
jackwener merged 3 commits intojackwener:mainfrom
xtftbwvfp:main
Mar 29, 2026
Merged

feat: add 知识星球(zsxq) site adapter#571
jackwener merged 3 commits intojackwener:mainfrom
xtftbwvfp:main

Conversation

@xtftbwvfp
Copy link
Copy Markdown
Contributor

Summary

Add cookie-based site adapter for 知识星球 (zsxq.com) with 5 commands:

Command Description
opencli zsxq groups List joined groups
opencli zsxq topics List topics in current group
opencli zsxq topic <id> Get single topic detail with comments
opencli zsxq search <keyword> Search topics within a group
opencli zsxq dynamics Latest cross-group activity feed

Implementation Details

  • Strategy: Strategy.COOKIE with browser: true
  • API: Calls https://api.zsxq.com/v2/ endpoints via XHR in Chrome (credential forwarding)
  • Auth detection: Validates login by attempting a lightweight API call instead of checking cookies (zsxq uses httpOnly cookies on different subdomains)
  • Default group: Reads from localStorage or falls back to first joined group from API
  • Search: Resolves group name via groups API for display

Files Added

src/clis/zsxq/

  • utils.ts — Shared types, API helper, response parsing
  • groups.ts — List joined groups
  • topics.ts — List topics (with pagination via count)
  • topic.ts — Single topic detail + comments
  • search.ts — Search within a group
  • dynamics.ts — Cross-group activity feed

Testing

Tested with 5 joined groups, all commands return correct data.

xiaojian and others added 3 commits March 29, 2026 11:49
Add cookie-based adapter for 知识星球 (zsxq.com) with 5 commands:
- groups: list joined groups
- topics: list topics in current group
- topic: get single topic detail with comments
- search: search topics within a group
- dynamics: latest cross-group activity feed

Uses XHR over Chrome extension (Strategy.COOKIE) to call
https://api.zsxq.com/v2/ APIs with credential forwarding.
@jackwener jackwener merged commit d8d9643 into jackwener:main Mar 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants