weibo-cli
v0.1.0
Published
Command-line tool to publish posts on weibo.com using Playwright and TypeScript.
Maintainers
Readme
Weibo CLI
CLI tool to interact with weibo.com using the internal HTTP API.
Playwright is used only for initial login to save cookies.
Installation
npm install
npm run build
npm link # optional, to make `weibo` available globallyAuthentication (one-time setup)
weibo loginA browser will open. Log into Weibo, then press Enter in the terminal to save cookies.
Quick Examples
# Post a status
weibo post "Hello from CLI!"
# Show a status
weibo status show QixevsT6m
# Like a status
weibo status like 5116339025260613
# Get your home feed
weibo feed home --count 10
# Output raw JSON
weibo feed home --jsonCommand Reference
weibo [options] <command>
Global Options:
-c, --cookies <path> Path to cookies file (default: weibo-cookies.json)
--json Output raw JSON
-v, --verbose Verbose logging
Commands:
login Open browser for login and save cookies
post <text> Publish a new post
status <subcommand> Status operations
feed <subcommand> Feed operations
Status Subcommands:
status show <id> Show a status
status delete <id> Delete a status
status like <id> Like a status
status repost <id> Repost a status
status comment <id> <text> Comment on a status
Feed Subcommands:
feed home Fetch friends/home timeline
feed group <list-id> Fetch group timeline
feed unreads Fetch unread timelineEnvironment Variables
Instead of a cookies file, you can set:
WEIBO_COOKIE- Cookie header valueWEIBO_XSRF_TOKEN- XSRF token value
