Skip to content

feat(weibo): add statuses command to fetch user timeline#1256

Open
ZepPellN wants to merge 2 commits intojackwener:mainfrom
ZepPellN:feat/weibo-statuses
Open

feat(weibo): add statuses command to fetch user timeline#1256
ZepPellN wants to merge 2 commits intojackwener:mainfrom
ZepPellN:feat/weibo-statuses

Conversation

@ZepPellN
Copy link
Copy Markdown
Contributor

@ZepPellN ZepPellN commented May 3, 2026

Summary

Adds opencli weibo statuses <id> command to fetch a specific user's Weibo timeline.

Currently opencli supports:

  • weibo user <id> — user profile
  • weibo post <id> — single post detail
  • weibo feed — personal for-you / following timeline

But there is no way to list a specific user's statuses. This PR fills that gap.

What Changed

  • New adapter: clis/weibo/statuses.js
  • Uses /ajax/statuses/mymblog?uid=<uid>&page=<page>&feature=0 API (discovered via browser network capture)
  • Resolves screen_name → uid automatically if a non-numeric ID is provided
  • Returns rich metadata: id, mblogid, text, isLongText, created_at, reposts, comments, likes, pic_num, url, plus retweeted and page_info when available

Usage

# By UID
opencli weibo statuses 1233486457 --limit 5

# By screen name
opencli weibo statuses "高飞" --limit 10 --page 2

# JSON output
opencli weibo statuses 1233486457 --limit 5 -f json

Test Plan

  • opencli validate passes
  • E2E tested against real Weibo user pages (authenticated cookie session)
  • Both numeric UID and screen_name resolution work
  • Long text flag, retweeted content, and page_info are correctly extracted
  • Pagination (--page) works

Notes

  • Requires cookie authentication (same as other weibo commands)
  • text is capped at 500 chars in list view; use weibo post <mblogid> for full long-text expansion

jean added 2 commits April 29, 2026 00:20
Add Z-Library adapter with two browser-based commands:

- `search` — Search books by title, author, or ISBN.
  Navigates to /s/<query> and extracts results from
  <z-bookcard> shadow DOM custom elements.

- `info` — Get book details and available download formats
  from a book page URL.

Uses Strategy.COOKIE with browser automation to bypass
Cloudflare protection. The adapter reuses the user's existing
Z-Library login cookies from system Chrome.

Known limitation: actual file downloading requires Playwright's
download event handling (page.on('download')). OpenCLI's browser
automation does not currently intercept file downloads. Users
needing to download files should use Playwright to navigate to
the book URLs discovered by this adapter.
Add `opencli weibo statuses <id>` command to fetch a user's
Weibo statuses/timeline via /ajax/statuses/mymblog API.

Supports:
- uid (numeric) or screen_name as positional arg
- --limit (max 50, default 15)
- --page for pagination
- Returns: id, mblogid, text, isLongText, created_at,
  reposts, comments, likes, pic_num, url
- Includes retweeted content and page_info when available

Closes gap where opencli weibo had user/profile and single
post fetch, but no way to list a specific user's statuses.
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