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
@@ -1,4 +1,9 @@
|
||||
import { getQzoneMsgList, type QzoneMsgListResult } from '@snowluma/protocol/web/qzone';
|
||||
import {
|
||||
getQzoneFeeds,
|
||||
getQzoneMsgList,
|
||||
type QzoneFeedsResult,
|
||||
type QzoneMsgListResult,
|
||||
} from '@snowluma/protocol/web/qzone';
|
||||
import type { BridgeContext } from '../bridge-context';
|
||||
|
||||
/**
|
||||
@@ -19,4 +24,13 @@ export class QzoneApi {
|
||||
const cookieObject = await this.ctx.apis.web.getCookies('qzone.qq.com');
|
||||
return getQzoneMsgList(cookieObject, uin, pos, num);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取好友动态(feed)。`pageNum` 为 1 起的页码,`count` 为本页数量。
|
||||
* 始终以机器人自己的身份拉取好友动态。
|
||||
*/
|
||||
async getFeeds(pageNum = 1, count = 10): Promise<QzoneFeedsResult> {
|
||||
const cookieObject = await this.ctx.apis.web.getCookies('qzone.qq.com');
|
||||
return getQzoneFeeds(cookieObject, this.ctx.identity.uin, pageNum, count);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user