get-netease-news-trending
Fetch trending news from NetEase covering politics, society, finance, tech, and entertainment. Stay updated with comprehensive Chinese news trends.
Instructions
获取网易新闻热点榜,包含时政要闻、社会事件、财经资讯、科技动态及娱乐体育的全方位中文新闻资讯
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/netease-news.ts:3-27 (registration)Registers the 'get-netease-news-trending' tool using defineToolConfig, specifying name, description, and the handler function.export default defineToolConfig({ name: 'get-netease-news-trending', description: '获取网易新闻热点榜,包含时政要闻、社会事件、财经资讯、科技动态及娱乐体育的全方位中文新闻资讯', func: async () => { const resp = await http.get<{ code: number; data: { list: any[]; }; }>('https://m.163.com/fe/api/hot/news/flow'); if (resp.data.code !== 200 || !Array.isArray(resp.data.data.list)) { throw new Error('获取网易新闻热点榜失败'); } return resp.data.data.list.map((item) => { return { title: item.title, cover: item.imgsrc, source: item.source, publish_time: item.ptime, link: item.url, }; }); }, });
- src/tools/netease-news.ts:6-26 (handler)Handler function fetches trending news from Netease API endpoint, validates the response code and data structure, then maps the news list to objects containing title, cover image, source, publish time, and link.func: async () => { const resp = await http.get<{ code: number; data: { list: any[]; }; }>('https://m.163.com/fe/api/hot/news/flow'); if (resp.data.code !== 200 || !Array.isArray(resp.data.data.list)) { throw new Error('获取网易新闻热点榜失败'); } return resp.data.data.list.map((item) => { return { title: item.title, cover: item.imgsrc, source: item.source, publish_time: item.ptime, link: item.url, }; }); },