feat(qzone): get_qzone_feeds — read friend feeds (好友动态) via web API
Second read-only Qzone slice. getQzoneFeeds over ic2.qzone.qq.com's feeds3_html_more CGI, same cookie/g_tk plumbing + JSONP-tolerant parse + throw-on-auth-failure contract as get_qzone_msg_list. Surfaces the stable structured fields (uin/nickname/time/appid/key) and passes the pre-rendered html blob through verbatim — deep HTML→segment parsing is left to callers. Paginated via page_num (1-based) + count. - protocol/web/qzone.ts: getQzoneFeeds + mapFeeds. - core: QzoneApi.getFeeds (always the bot's own identity). - onebot: get_qzone_feeds action; regenerated MCP catalog. - tests: feeds mapping, HTTP url/params, empty-feed→[], auth-throw, and bridge pageNum/count threading. Exact CGI field names / pagination cursor to be re-confirmed against a live capture (same posture as the msglist helper).
This commit is contained in:
6 files changed
+293
-3
No files matched your search
@@ -26,6 +26,27 @@ export const actions = [
|
||||
}
|
||||
},
|
||||
}),
|
||||
|
||||
// get_qzone_feeds — 获取好友动态(feed)。只读,始终以机器人自己身份拉取。
|
||||
// 每条 feed 含结构化字段 + 预渲染 html 原样透传(深度解析交由调用方)。
|
||||
defineAction({
|
||||
name: 'get_qzone_feeds',
|
||||
readOnly: true,
|
||||
summary: '获取 QQ 空间好友动态(feed)',
|
||||
params: {
|
||||
page_num: f.int({ min: 1 }).describe('页码(1 起)').default(1),
|
||||
count: f.int({ min: 1, max: 50 }).describe('本页数量').default(10),
|
||||
},
|
||||
run: async (p, ctx) => {
|
||||
try {
|
||||
const res = await ctx.bridge.apis.qzone.getFeeds(p.page_num, p.count);
|
||||
return okResponse(res as unknown as JsonValue);
|
||||
} catch (error) {
|
||||
const message = error instanceof Error ? error.message : 'failed to get qzone feeds';
|
||||
return failedResponse(RETCODE.INTERNAL_ERROR, message);
|
||||
}
|
||||
},
|
||||
}),
|
||||
];
|
||||
|
||||
export function register(h: ApiHandler, ctx: ApiActionContext): void {
|
||||
|
||||
Reference in new issue
Block a user