Skip to content

Add latest sort for Xiaohongshu search#1833

Draft
Connor1996 wants to merge 1 commit into
jackwener:mainfrom
Connor1996:codex/xiaohongshu-latest-sort
Draft

Add latest sort for Xiaohongshu search#1833
Connor1996 wants to merge 1 commit into
jackwener:mainfrom
Connor1996:codex/xiaohongshu-latest-sort

Conversation

@Connor1996
Copy link
Copy Markdown

Summary

Adds a --sort option to xiaohongshu search with support for general and latest.

The latest path uses the existing browser adapter flow: it opens the search page, dismisses common Xiaohongshu blocking notices, opens the filter panel, selects the 最新 sort option, waits for the page to refresh, and then extracts results from the rendered DOM.

This also updates publish-time extraction to prefer the visible page label such as 34分钟前 or 1小时前 before falling back to the note-id timestamp heuristic. The shared Rednote search mapping now preserves that extracted published_at value too.

Validation

  • npx vitest run --project adapter clis/xiaohongshu/search.test.js
  • npm run build-manifest
  • Live: node dist/src/main.js xiaohongshu search '#湾区租房' --limit 5 --sort latest -f json --window background --site-session persistent --trace retain-on-failure\n- Live: node dist/src/main.js xiaohongshu search '#湾区转租' --limit 3 --sort latest -f json --window background --site-session persistent --trace retain-on-failure

Signed-off-by: Connor1996 <zbk602423539@gmail.com>
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.

1 participant