feat(xiaohongshu): add note command and nested reply support for comments#599
Merged
jackwener merged 4 commits intoMar 30, 2026
Merged
Conversation
…ents
Add `xiaohongshu note` command to read full note content (title, author,
description, engagement metrics, tags) from public note pages.
Enhance `xiaohongshu comments` with `--with-replies` flag to extract
nested replies (楼中楼), including reply_to attribution and per-reply
like counts. Limit logic counts only top-level comments so replies
are included for free.
Extract shared `parseNoteId` into side-effect-free `note-helpers.ts`
to avoid cross-module command registration leakage.
Normalize non-numeric engagement placeholders ("赞"/"收藏"/"评论")
to "0" for zero-count notes.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Update xiaohongshu adapter documentation and README command table to reflect the new note command and enhanced comments with nested reply support. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
a8cb8cd to
85f8be3
Compare
Owner
|
Merged after review. I specifically looked at the design intent here: complete the xiaohongshu content-reading chain and make nested replies actually reliable. I patched the reply flow so --with-replies expands reply threads before scraping, hardened limit parsing, and validated with targeted Vitest, typecheck, and build before merge. Thanks for the contribution. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
xiaohongshu notecommand: Read full note content (title, author, description, engagement metrics, tags) from any public note pagexiaohongshu comments --with-replies: Extract nested replies (楼中楼) withreply_toattribution and per-reply like countsnote-helpers.ts: Side-effect-freeparseNoteIdandbuildNoteUrlutilities, avoiding cross-module command registration leakagexsec_token, navigate to it directly instead of stripping the token (fixes XHS security block on bare/explore/<id>access)New files
src/clis/xiaohongshu/note.ts— note content readersrc/clis/xiaohongshu/note.test.ts— 13 testssrc/clis/xiaohongshu/note-helpers.ts— shared URL parsing utilitiesModified files
src/clis/xiaohongshu/comments.ts—--with-repliesflag,buildNoteUrlnavigationsrc/clis/xiaohongshu/comments.test.ts— reply-related testsTest plan
opencli xiaohongshu note <url>returns title, author, content, likes, collects, comments, tagsopencli xiaohongshu comments <url> --with-repliesreturns main comments + nested replies withis_reply/reply_tocolumns🤖 Generated with Claude Code