Rebuild on kit: status, comments, suggest alongside hot - #1
Merged
Conversation
Migrates from a bare cobra/fang setup to the any-cli/kit framework so all
four read ops (hot, status, comments, suggest) are exposed as CLI, HTTP
(serve), and MCP (mcp) from a single registration.
New public surfaces — all anonymous, no cookies:
- status <id> fetch one post by numeric id or URL
- comments <id> top comments under a post (up to 20 per page)
- suggest <q> search autocomplete (hotquery from weibo.com sidebar)
hot is rewritten on the same kit model; the existing behaviour is unchanged.
Status text and comment text have HTML stripped (br→space, tag regex).
Weibo timestamps ("Mon Jun 15 09:05:12 +0800 2026") are normalised to UTC
"2026-06-15 01:05:12". Two hosts are used: weibo.com for desktop endpoints,
m.weibo.cn (mobile headers) for statuses/show and comments/hotflow.
Removes pkg/render (kit handles table/json/jsonl/csv/tsv/url rendering).
Adds github.com/tamnd/any-cli v0.4.0.
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
weibo serve), and MCP (weibo mcp) from one registrationweibo status <id>— fetch one post by numeric id or URLweibo comments <id>— top comments under a post (up to 20 per page, paginated viamax_id)weibo suggest <query>— search autocomplete from the Weibo search sidebarweibo hotis rewritten on the same kit model; existing behaviour is unchangedTest plan
go test ./...greenweibo hot -n 5returns 5 ranked rowsweibo status 5309997458393240returns a post with stripped text and normalised dateweibo comments 5309997458393240 -n 3returns 3 commentsweibo suggest 山姆returns autocomplete rowsweibo servebinds on :8080 and responds at /v1/hotweibo mcpstarts up without error