mcpField
H
hot-topics

hot-topics

github.com/vikiboss其他472.0k 次安装34 周前更新
代码仓库

关于 hot-topics

Hot Topics 是一项帮助 AI Agent 获取中国内容平台当前热搜和热门讨论的技能。它列出六个平台的 GET 接口,并提供跨平台比较热点的示例。

主要功能

  1. 01获取六个中国平台的热点
  2. 02列出各平台的 GET 接口
  3. 03支持跨平台话题比较
  4. 04提供热点汇总示例

适用场景

  1. 01整理每日热点摘要
  2. 02比较不同平台的热门话题
  3. 03查询关键词是否正在走热

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/vikiboss/60s-skills --skill hot-topics

安装后在 Claude Code 中输入/hot-topics确认已加载。

详细介绍

热点话题与热门内容技能

这项技能可帮助 AI Agent 获取中国主要社交媒体和内容平台的热门话题与热搜。

何时使用这项技能

在用户有以下需求时使用这项技能:

  • 想了解社交媒体上的热门趋势
  • 询问热门话题或爆款内容
  • 需要了解当前热门讨论
  • 想追踪各个平台的热门话题
  • 研究社交媒体趋势

支持的平台

  1. Weibo(微博) - 中国版 Twitter
  2. Zhihu(知乎) - 中国版 Quora
  3. Baidu(百度) - 中国最大的搜索引擎
  4. Douyin(抖音) - 中国版 TikTok
  5. Toutiao(今日头条) - ByteDance 新闻聚合平台
  6. Bilibili(B 站) - 中国版 YouTube

API 端点

平台端点说明
Weibo/v2/weiboWeibo 热搜话题
Zhihu/v2/zhihuZhihu 热门问题
Baidu/v2/baidu/hotBaidu 热搜
Douyin/v2/douyinDouyin 热门视频
Toutiao/v2/toutiaoToutiao 热门新闻
Bilibili/v2/biliBilibili 热门视频

所有端点均使用 GET 方法,基础 URL 为:https://60s.viki.moe/v2

使用方法

获取 Weibo 热搜
import requests

def get_weibo_hot():
    response = requests.get('https://60s.viki.moe/v2/weibo')
    return response.json()

hot_topics = get_weibo_hot()
print("🔥 微博热搜:")
for i, topic in enumerate(hot_topics['data'][:10], 1):
    print(f"{i}. {topic['title']} - 热度: {topic['热度']}")
获取 Zhihu 热门话题
def get_zhihu_hot():
    response = requests.get('https://60s.viki.moe/v2/zhihu')
    return response.json()

topics = get_zhihu_hot()
print("💡 知乎热榜:")
for topic in topics['data'][:10]:
    print(f"· {topic['title']}")
获取多个平台的热门趋势
def get_all_hot_topics():
    platforms = {
        'weibo': 'https://60s.viki.moe/v2/weibo',
        'zhihu': 'https://60s.viki.moe/v2/zhihu',
        'baidu': 'https://60s.viki.moe/v2/baidu/hot',
        'douyin': 'https://60s.viki.moe/v2/douyin',
        'bili': 'https://60s.viki.moe/v2/bili'
    }
    
    results = {}
    for name, url in platforms.items():
        try:
            response = requests.get(url)
            results[name] = response.json()
        except:
            results[name] = None
    
    return results

# Usage
all_topics = get_all_hot_topics()
简单的 bash 示例
# Weibo hot search
curl "https://60s.viki.moe/v2/weibo"

# Zhihu trending
curl "https://60s.viki.moe/v2/zhihu"

# Baidu hot search
curl "https://60s.viki.moe/v2/baidu/hot"

# Douyin trending
curl "https://60s.viki.moe/v2/douyin"

# Bilibili trending
curl "https://60s.viki.moe/v2/bili"

响应格式

响应通常包含:

{
  "data": [
    {
      "title": "话题标题",
      "url": "https://...",
      "热度": "1234567",
      "rank": 1
    },
    ...
  ],
  "update_time": "2024-01-15 14:00:00"
}

交互示例

用户:“现在微博上什么最火?”
hot = get_weibo_hot()
top_5 = hot['data'][:5]

response = "🔥 微博热搜 TOP 5:\n\n"
for i, topic in enumerate(top_5, 1):
    response += f"{i}. {topic['title']}\n"
    response += f"   热度:{topic.get('热度', 'N/A')}\n\n"
用户:“知乎上大家在讨论什么?”
zhihu = get_zhihu_hot()
response = "💡 知乎当前热门话题:\n\n"
for topic in zhihu['data'][:8]:
    response += f"· {topic['title']}\n"
用户:“对比各平台热点”
def compare_platform_trends():
    all_topics = get_all_hot_topics()
    
    summary = "📊 各平台热点概览\n\n"
    
    platforms = {
        'weibo': '微博',
        'zhihu': '知乎',
        'baidu': '百度',
        'douyin': '抖音',
        'bili': 'B站'
    }
    
    for key, name in platforms.items():
        if all_topics.get(key):
            top_topic = all_topics[key]['data'][0]
            summary += f"{name}:{top_topic['title']}\n"
    
    return summary

最佳实践

  1. 频率限制:不要过于频繁地调用 API,数据每隔几分钟更新一次
  2. 错误处理:始终处理网络错误和无效响应
  3. 缓存:缓存结果 5-10 分钟,以减少 API 调用
  4. 前 N 项:通常展示前 5-10 项就足够了
  5. 上下文:展示热门话题时,提供平台背景信息

常见用例

1. 每日热门趋势摘要
def get_daily_trending_summary():
    weibo = get_weibo_hot()
    zhihu = get_zhihu_hot()
    
    summary = "📱 今日热点速览\n\n"
    summary += "【微博热搜】\n"
    summary += "\n".join([f"{i}. {t['title']}" 
                          for i, t in enumerate(weibo['data'][:3], 1)])
    summary += "\n\n【知乎热榜】\n"
    summary += "\n".join([f"{i}. {t['title']}" 
                          for i, t in enumerate(zhihu['data'][:3], 1)])
    
    return summary
2. 查找各平台的共同话题
def find_common_topics():
    all_topics = get_all_hot_topics()
    
    # Extract titles from all platforms
    all_titles = []
    for platform_data in all_topics.values():
        if platform_data and 'data' in platform_data:
            all_titles.extend([t['title'] for t in platform_data['data']])
    
    # Simple keyword matching (can be improved)
    from collections import Counter
    keywords = []
    for title in all_titles:
        keywords.extend(title.split())
    
    common = Counter(keywords).most_common(10)
    return f"🔍 热门关键词:{', '.join([k for k, _ in common])}"
3. 平台专属热门趋势提醒
def check_trending_topic(keyword):
    platforms = ['weibo', 'zhihu', 'baidu']
    found_in = []
    
    for platform in platforms:
        url = f'https://60s.viki.moe/v2/{platform}' if platform != 'baidu' else 'https://60s.viki.moe/v2/baidu/hot'
        data = requests.get(url).json()
        
        for topic in data['data']:
            if keyword.lower() in topic['title'].lower():
                found_in.append(platform)
                break
    
    if found_in:
        return f"✅ 话题 '{keyword}' 正在以下平台trending: {', '.join(found_in)}"
    return f"❌ 话题 '{keyword}' 未在主流平台trending"
4. 热门内容推荐
def recommend_content_by_interest(interest):
    """Recommend trending content based on user interest"""
    all_topics = get_all_hot_topics()
    
    recommendations = []
    for platform, data in all_topics.items():
        if data and 'data' in data:
            for topic in data['data']:
                if interest.lower() in topic['title'].lower():
                    recommendations.append({
                        'platform': platform,
                        'title': topic['title'],
                        'url': topic.get('url', '')
                    })
    
    return recommendations

平台专属说明

Weibo(微博)
  • 更新频繁(每隔几分钟)
  • 包含“热度”(热度分数)
  • 部分话题可能带有“热”或“新”等标签
Zhihu(知乎)
  • 侧重问题与讨论
  • 话题通常更深入
  • 有助于了解人们感兴趣的问题
Baidu(百度)
  • 反映搜索趋势
  • 是大众关注度的良好指标
  • 包含多个类别
Douyin(抖音)
  • 侧重视频热门趋势
  • 涵盖娱乐和生活方式内容
  • 反映年轻受众的兴趣
Bilibili(B 站)
  • 视频平台热门趋势
  • ACG(动画、漫画、游戏)文化
  • 侧重创意内容

故障排查

问题:数据为空或为 null
  • 解决方案:API 可能正在更新,请几秒后重试
  • 检查网络连接
问题:时间戳较旧
  • 解决方案:数据已缓存,这属于正常情况
  • 大多数平台每隔 5-15 分钟更新一次
问题:缺少平台
  • 解决方案:确保端点 URL 正确
  • 查看 API 文档,确认是否有变更

相关资源

评论

支持 Markdown