Files
social-router/packages/xhs/src/test/query/mention.ts
2025-05-03 04:48:12 +08:00

30 lines
978 B
TypeScript

import { xhsServices, program } from '../common.ts';
import util from 'node:util';
const getMentions = async () => {
try {
const client = xhsServices.getClient();
const res = await client.getMention(1);
if (res.code) {
const data = res.data || {};
console.log('getMentionNotifications', util.inspect(data, { depth: 10 }));
}
} catch (e) {
console.error('error');
}
};
program.command('mention').description('get mention notifications').action(getMentions);
const getTestMentionNote = async () => {
const id = '68136dab0000000007034c46';
const xsec_token = 'LByEmonX8WfJ9ebpAowVbOZcNgtJAAC8K2zx5Rmr_9Q7Y=';
const title = '在笔记中@了你';
const type = 'mention/item';
const track_type = '2';
const client = xhsServices.getClient();
const note = await client.getNoteByIdFromHtml(id, xsec_token);
console.log('note', note);
};
program.command('test-mention').description('get mention note').action(getTestMentionNote);