Skip to content

feat(xiaohongshu): add published_at to search results#485

Merged
jackwener merged 1 commit intojackwener:mainfrom
Astro-Han:worktree-xhs-search-publish-time
Mar 27, 2026
Merged

feat(xiaohongshu): add published_at to search results#485
jackwener merged 1 commit intojackwener:mainfrom
Astro-Han:worktree-xhs-search-publish-time

Conversation

@Astro-Han
Copy link
Copy Markdown
Contributor

@Astro-Han Astro-Han commented Mar 27, 2026

Description

Add published_at column to xiaohongshu search by deriving approximate publish date from note IDs. XHS note IDs follow MongoDB ObjectID format where the first 8 hex characters encode a Unix timestamp. This is parsed client-side with UTC+8 offset for China timezone, requiring zero extra network requests.

Related issue: #484

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • 🌐 New site adapter
  • 📝 Documentation
  • ♻️ Refactor
  • 🔧 CI / build / tooling

Checklist

  • I ran the checks relevant to this PR
  • I updated tests or docs if needed
  • I included output or screenshots when useful

Documentation (if adding/modifying an adapter)

  • Added doc page under docs/adapters/ (if new adapter)
  • Updated docs/adapters/index.md table (if new adapter)
  • Updated sidebar in docs/.vitepress/config.mts (if new adapter)
  • Updated README.md / README.zh-CN.md when command discoverability changed
  • Used positional args for the command's primary subject unless a named flag is clearly better
  • Normalized expected adapter failures to CliError subclasses instead of raw Error

Screenshots / Output

$ opencli xiaohongshu search '特斯拉' --limit 3
┌───────┬──────────────────────────────────────────┬──────────────────┬───────┬──────────────┬────────────────────┐
│ rank  │ title                                    │ author           │ likes │ published_at │ url                │
├───────┼──────────────────────────────────────────┼──────────────────┼───────┼──────────────┼────────────────────┤
│ 1     │ 廉价版特斯拉Model 3标准版生产线落地上海  │ 大厂新视野       │ 4     │ 2026-03-26   │ https://...        │
│ 2     │ 特斯拉最新价格预测...                    │ W隐于市W         │ 18    │ 2026-03-24   │ https://...        │
│ 3     │ 每日一家公司职场内幕——特斯拉(上海)      │ 打工没有自由     │ 221   │ 2025-12-29   │ https://...        │
└───────┴──────────────────────────────────────────┴──────────────────┴───────┴──────────────┴────────────────────┘

Derive approximate publish date from note IDs, which follow MongoDB
ObjectID format (first 8 hex chars = Unix timestamp). Exported as a
pure function with UTC+8 offset for China timezone.

Closes jackwener#484
@jackwener jackwener merged commit 1a44d8c into jackwener:main Mar 27, 2026
23 checks passed
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