Skip to main content
Glama

Trends Hub

weibo.ts1.14 kB
import { URL } from 'node:url'; import { defineToolConfig, http } from '../utils'; export default defineToolConfig({ name: 'get-weibo-trending', description: '获取微博热搜榜,包含时事热点、社会现象、娱乐新闻、明星动态及网络热议话题的实时热门中文资讯', func: async () => { const resp = await http.get<{ ok: number; data: { realtime: any[]; }; }>('https://weibo.com/ajax/side/hotSearch'); if (resp.data.ok !== 1 || !Array.isArray(resp.data.data.realtime)) { throw new Error('获取微博热搜榜失败'); } return resp.data.data.realtime .filter((item) => item.is_ad !== 1) .map((item: any) => { const key = item.word_scheme || `#${item.word}`; const url = new URL('https://s.weibo.com/weibo'); url.searchParams.set('q', key); url.searchParams.set('band_rank', '1'); url.searchParams.set('Refer', 'top'); return { title: item.word, description: item.note || key, popularity: item.num, link: url.toString(), }; }); }, });

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/baranwang/mcp-trends-hub'

If you have feedback or need assistance with the MCP directory API, please join our Discord server