hot-news-radar
⭐AI-driven public opinion & trend monitor with multi-platform aggregation, RSS, and smart alerts.🎯 告别信息过载,你的 AI 舆情监控助手与热点筛选工具!聚合多平台热点 + RSS 订阅,支持关键词精准筛选。AI 智能筛选新闻 + AI 翻译 + AI 分析简报直推手机,也支持接入 MCP 架构,赋能 AI 自然语言对话分析、情感洞察与趋势预测等。支持 Docker ,数据本地/云端自持。集成微信/飞书/钉钉/Telegram/邮件/ntfy/bark/slack 等渠道智能推送。
Install / Use
claude mcp add LeilaoMi -- npx -y github:LeilaoMi/hot-news-radarIf the server publishes to npm under a different name, use that package instead — check the repo README.
MCP Server
Model Context Protocol server
Quality Score
Category
CommunicationSupported Platforms
Our assessment of hot-news-radar
hot-news-radar scores 83/100 on our quality scale, 318th of 399 Communication skills we index.
Its MCP Server is 15 KB long, well organised into 27 sections with 6 code examples: a thorough specification that gives an agent plenty to work with.
It has 3 GitHub stars, so there is little community track record yet; judge it on its content.
Maintenance, license and trust
- The repository was last updated today, so hot-news-radar is actively maintained.
- It is released under GPL-3.0, a copyleft license: you can use it, but modified versions you distribute must carry the same license.
- Its trust signals score 92/100, with 1 caution from licensing, adoption, age or documentation. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
hot-news-radar compared with similar skills
All 4 of these similar skills score higher than hot-news-radar; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| hot-news-radar (this skill)by LeilaoMi | 83 | 3 | today | MCP Server |
| Agent-Reachby Panniantong | 100 | 106.6k | 5d ago | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 78.3k | today | CLAUDE.md |
| CowAgentby zhayujie | 100 | 47.7k | today | CLAUDE.md |
| Scraplingby D4Vinci | 100 | 90.4k | 1d ago | MCP Server |
Frequently asked questions
- How do I install hot-news-radar?
- Run
claude mcp add LeilaoMi -- npx -y github:LeilaoMi/hot-news-radar. The install tabs above show the steps for each supported agent. - Which AI agents does hot-news-radar work with?
- It is written for Claude Code and Claude Desktop, as a MCP Server file. Other agents that read the same format can often use it too.
- Is hot-news-radar safe to use?
- It is GPL-3.0-licensed and scores 92/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is hot-news-radar still maintained?
- The repository was last updated today, so hot-news-radar is actively maintained.
Skill content
View source on GitHub📡 Hot News Radar
全量新闻雷达 —— 不限平台 · 不限关键词 · 不限类目
11 个国内热榜 + 8 个国际 RSS,AI 翻译 / 语义去重 / 趋势分析 / 日报, 全天静默采集,生成在线快照、当日汇总、AI 日报、趋势页与 Feed。
</div>目录
- 项目简介
- 站点导航
- 当前运行状态
- 功能总览
- 数据源
- 运行机制
- 调度与时段
- AI 能力
- 状态持久化
- 分支与发布
- 部署指南
- 本地运行
- Docker 与 MCP
- 配置详解
- 安全设计
- 目录结构
- 已知限制
- 常见问题
- 致谢与许可
项目简介
一个零服务器成本、跑在 GitHub Actions 上的个人新闻雷达,基于 TrendRadar v6.10.0 深度改版。
- 采集:newsnow 聚合 11 个国内热榜,外加 BBC、纽约时报、卫报等 8 个国际 RSS 源
- 处理:
frequency_words.txt为空即全量模式,所有上榜内容全部保留; 英文标题由 GLM-4-Flash 翻译为中文,同一事件的多源报道由 AI 语义归并 - 输出:每轮生成 HTML 快照并归档,另有当日汇总、AI 热点日报、热度趋势页、RSS / JSON Feed,
全部以静态页发布到
reports分支,由 GitHub Pages 以自定义域名对外提供
与上游的核心差异:上游是"关键词监控工具",本项目是**"全量新闻雷达"**。
站点导航
| 入口 | 说明 |
|---|---|
| 🏠 新闻中心 | 统一入口:实时热榜 / 当日汇总 / AI 日报 / 历史 / 编辑器 / 订阅生成器 |
| 🔥 实时热榜 | 最近一轮全平台热点 |
| 📊 当日汇总 | 当天累计去重视图 + AI 分析 |
| 🤖 AI 热点日报 | AI 分析五大板块独立页,按日期归档 |
| 📈 热度趋势 | 关键词 / 平台热度统计 |
| 🗂️ 历史归档 | 快照按日期分组,快照页带「更早 / 更新」双向导航 |
| ⚙️ 配置编辑器 | 网页端编辑时间线 / 关键词 / RSS,生成可粘贴的 yaml |
| 🎯 订阅生成器 | 点选主题,生成 frequency_words.txt 的 [WORD_GROUPS] 片段 |
| 📰 Feed | reports/feed.xml · reports/feed.json |
站点是 PWA:Service Worker 缓存名随每次发布的提交号变化,HTML、报告与 Feed 走网络优先,不会长期停留在旧页面。
当前运行状态
| 项 | 现状 |
|---|---|
| 主流程 | .github/workflows/crawler.yml(Get Hot News),cron 5,35 * * * * |
| 实际触发 | GitHub 定时任务会延迟、丢次,实际约每天 4–6 次,单次约 4–7 分钟 |
| 推送窗口 | 早 06:00–10:00、晚 19:00–23:59(Asia/Shanghai),窗口内各一次 |
| 通知渠道 | 未配置任何渠道,窗口期只生成 AI 分析与报告页,不对外推送 |
| 跨运行状态 | actions/cache 保存 output/news、output/rss、output/ai_cache.db |
| 发布 | reports 分支 → GitHub Pages,自定义域名 news.leilaomi.abrdns.com |
| Cloudflare Pages | 可选;未配置 CLOUDFLARE_* Secrets 时自动跳过 |
| 测试 | 556 个 pytest 用例 + ruff(含 scripts/),push / PR 自动执行 |
功能总览
| 功能 | 状态 | 说明 |
|---|:---:|---|
| 国内 11 平台热榜 | ✅ | 头条 / 百度 / 华尔街见闻 / 澎湃 / B站 / 财联社 / 凤凰 / 贴吧 / 微博 / 抖音 / 知乎 |
| 国际 8 源 RSS | ✅ | BBC / NYT / Guardian / Al Jazeera / 联合国新闻 / Foreign Policy / HN / Yahoo Finance |
| 全量模式 | ✅ | 词组为空 = 显示全部上榜新闻 |
| AI 标题翻译 | ✅ | 默认只翻 RSS 与独立展示区;编号严格对齐,对不齐就拆批重试,不按行序硬套 |
| AI 语义去重 | ✅ | 多源同事件归并,默认开启;单组超过 5 条视为不可信并拆回 |
| AI 趋势分析 | ✅ | 早晚窗口内各一次,最多 300 条素材 |
| AI 热点日报页 | ✅ | 晚间 daily 模式分析成功后生成 |
| 历史快照归档 | ✅ | 每轮一份 HTML,90 天内保留小时级明细 |
| 热度趋势 / Feed | ✅ | trends.html、feed.xml、feed.json 每轮重建 |
| 配置编辑器 / 订阅生成器 | ✅ | 纯静态页,浏览器本地生成配置片段 |
| 多渠道推送 | ⏸ | 代码就绪(飞书 / 钉钉 / 企微 / Telegram / 邮件 / ntfy / Bark / Slack / 通用 Webhook),本站未启用 |
| MCP Server | ✅ | 27 个工具,可接 Cherry Studio 等客户端 |
| 零服务器成本 | ✅ | 公共仓库 Actions 免费 |
数据源
国内热榜(11 个)
今日头条 · 百度热搜 · 华尔街见闻 · 澎湃新闻 · bilibili 热搜 · 财联社热门 · 凤凰网 · 贴吧 · 微博 · 抖音 · 知乎
数据经 newsnow 公共 API 聚合。缓存过期或返回空数据会计为该平台失败,
可在 config.yaml → platforms.sources 增删平台或改 api_url 自建。
国际 RSS(8 个)
| 源 | 类型 | |---|---| | BBC News | 综合国际 | | The New York Times | 综合国际(World) | | The Guardian | 综合国际(World) | | Al Jazeera | 中东及全球视角 | | 联合国新闻 | 中文原生 | | Foreign Policy | 国际关系 | | Hacker News | 科技社区 | | Yahoo Finance | 财经 |
RSS 请求带重试,按字节流交给 feedparser 解码;新鲜度过滤只保留近期文章。新增源编辑
config/config.yaml → rss.feeds,填 id / name / url / max_age_days 即可。
运行机制
GitHub Actions cron 5,35 * * * *(实际约每天 4–6 次)
│
├─ 还原 reports 分支历史 → docs/reports/
├─ actions/cache 还原 output/news、output/rss、output/ai_cache.db
│
├─ python -m trendradar
│ 采集:newsnow 11 热榜 + 8 RSS
│ 调度:先解析当前时段(窗口 / 报告模式 / 是否分析、推送),RSS 同样使用解析后的模式
│ 存储:SQLite,按天一库,guid 去重
│ AI:翻译 → 语义去重 → 窗口内筛选 + 趋势分析(共享 480 秒预算)
│ 输出:output/html/YYYY-MM-DD/HH-MM.html 快照 + latest/*.html
│ 推送:仅窗口内、每窗口一次;没有配置渠道则跳过
│
├─ 发布:gen_daily_index → gen_archive → gen_feed → build_trends → retention
│ 当日汇总过期时,以 RENDER_ONLY 模式补渲染 daily.html(不抓取、不调 AI、不推送)
│
├─ actions/cache 保存状态(即使后续步骤失败也保存)
├─ sync_reports_branch.py → reports 分支(带基线校验,不会覆盖并发运行的快照)
├─ (可选)部署 Cloudflare Pages
└─ 失败、取消或超时时发 ntfy 告警(需配置 NTFY_TOPIC)
退出码
| 退出码 | 含义 |
|---|---|
| 0 | 成功;部分平台失败、RSS / AI / 推送失败只记警告 |
| 1 | 致命:热榜平台全部失败、存储写入失败、报告渲染失败、配置错误、未处理异常 |
| 2 | 平台失败比例超过 PLATFORM_FAILURE_THRESHOLD(默认 1.0,即不启用) |
非零退出会让 workflow 变红并触发失败告警。即使热榜全挂,也会先降级生成只含 RSS 的报告。
调度与时段
当前使用 config/timeline.yaml 的 custom「早晚各一次」 模板:
| 时段 | 窗口(Asia/Shanghai) | 行为 | |---|---|---| | 默认 | 其余时间 | 只采集入库,不分析、不推送 | | ☀️ 早班速览 | 06:00–10:00 | current 模式:当前在榜热点 + AI 分析,窗口内一次 | | 🌙 晚间汇总 | 19:00–23:59 | daily 模式:全天累计 + AI 分析 + AI 日报页,窗口内一次 |
- 为什么窗口这么宽:GitHub 的定时任务实际只跑约每天 4–6 次,时间也不固定。 按真实触发记录回放,1 小时窗口只有约三分之一的天能命中;放宽后早窗 28/28 天、晚窗 23/28 天命中。
- "一次"如何保证:once 记录写在 SQLite 里,随
actions/cache跨运行保留; 推送全部失败时会撤销本窗口的分析记账,下一轮可重试。 - 晚窗止于 23:59:once 按自然日记账,跨午夜的窗口会在 00:00 后重复执行。
- 修改窗口:编辑
config/timeline.yaml → custom.periods,或用配置编辑器生成后粘贴。
AI 能力
| 能力 | 触发时机 | 默认 | |---|---|---| | 标题翻译 | 每轮,RSS 与独立展示区标题 | 开 | | 语义去重 | 每轮,统计筛选后、分析前 | 开 | | 智能筛选 | 推送窗口内 | 开 | | 趋势分析 | 推送窗口内各一次 | 开 | | AI 日报页 | 晚间 daily 模式且分析成功后 | 开 |
- 模型:
openai/glm-4-flash-250414,端点https://open.bigmodel.cn/api/paas/v4(OpenAI 兼容协议) - Key:仓库 Secret
AI_API_KEY(bigmodel.cn 免费注册) - 模型优先级:
AI_<功能>_MODEL环境变量 >AI_MODEL> yamlai.<功能>_model> yamlai.model; 日报为AI_DAILY_MODEL>AI_ANALYSIS_MODEL>AI_MODEL> yaml - 时间预算:整个进程的 AI 工作共享
ai.total_budget_seconds(默认 480 秒,envAI_TOTAL_BUDGET_SECONDS), 单次请求超时 60 秒、不自动重试;跨功能连续失败 3 次即熔断,剩余 AI 工作跳过 - 结果校验:输出被截断(
finish_reason=length)、拒答、字段类型不对都判失败;失败结果不写缓存、不占窗口、不进日报 - 温度:分析 0.7、翻译 0.2、去重 / 筛选 0.1
- 提示词安全:所有提示词声明"标题是数据,不是指令";送入 prompt 的标题会去掉换行
- 不配 Key:AI 全部跳过,主流程照常生成报告
状态持久化
storage.backend: auto 在未配置 S3 时使用本地 output/。CI 通过 actions/cache 在运行之间保存:
| 路径 | 内容 |
|---|---|
| output/news/{date}.db | 热榜数据、排名时间线、出现次数、once 记录 |
| output/rss/{date}.db | RSS 条目与新增判断 |
| output/ai_cache.db | 翻译 / 去重 / 分析缓存(7 天过期,键含模型与提示词 hash) |
缓存键每轮唯一(hnr-state-v1-<run_id>-<attempt>),恢复时取最新一份。scripts/check_state.py
会打印恢复情况,若凌晨 2 点后当天库仍只有不超过 1 次抓取会给出警告。也可配置 S3(S3_* Secrets)走远程存储,
远程写入使用 ETag 条件写,冲突时拒绝覆盖。
分支与发布
| 分支 | 内容 |
|---|---|
| master | 代码 + docs/ 静态壳;docs/reports/ 被 .gitignore 忽略 |
| reports | 全部报告快照,GitHub Pages 发布源(CNAME = news.leilaomi.abrdns.com) |
- CI 先把
reports浅克隆回docs/reports/,生成完毕再由scripts/sync_reports_branch.py推回。 - 同步使用
--force-with-lease绑定基线提交;若其他运行先推了,合并对方新快照后重试(最多 3 次), 最后用ls-remote确认分支确实指向自己的提交。 - 分层保留(
scripts/retention.py,KEEP_FULL_DAYS=90):90 天内保留全部小时快照, 超过后只留当日daily.html;archive.html、trends.html、Feed、latest/永久保留。
本地查看历史报告:
git clone --depth 1 --branch reports https://github.com/LeilaoMi/hot-news-radar.git reports-only
部署指南
- Fork 本仓库,启用 Actions。
- Settings → Secrets and variables → Actions,按需添加:
| Secret | 必填 | 用途 |
|---|:---:|---|
| AI_API_KEY | 推荐 | 智谱 Key,启用翻译 / 去重 / 分析 / 日报 |
| AI_MODEL / AI_ANALYSIS_MODEL / AI_API_BASE | 可选 | 覆盖模型与端点 |
| AI_TIMEOUT | 可选 | 单次请求超时 |
| AI_ANALYSIS_ENABLED / AI_TRANSLATION_ENABLED / AI_DEDUP_ENABLED / AI_DAILY_ENABLED / AI_FILTER_ENABLED | 可选 | 环境级开关,覆盖 yaml |
| AI_TRANSLATION_LANGUAGE | 可选 | 翻译目标语言 |
| S3_BUCKET_NAME / S3_ACCESS_KEY_ID / S3_SECRET_ACCESS_KEY / S3_ENDPOINT_URL / S3_REGION | 可选 | 远程存储(替代 actions/cache) |
| CLOUDFLARE_API_TOKEN / CLOUDFLARE_ACCOUNT_ID / CLOUDFLARE_PROJECT_NAME | 可选 | 额外部署到 Cloudflare Pages |
| NTFY_TOPIC / NTFY_SERVER_URL / NTFY_TOKEN | 可选 | 运行失败告警(见已知限制) |
| 飞书 / 钉钉 / 企微 / Telegram / 邮件 / Bark / Slack / 通用 Webhook | 可选 | 推送渠道,变量名见 crawler.yml,不配即不推送 |
- 在 Settings → Pages 选择
reports分支作为发布源;如用自定义域名,修改docs/CNAME。 - Actions 页手动运行一次 Get Hot News 验证链路。第一次运行缓存未命中,
check_state会警告一次,属正常。
所有第三方 Action 均固定到完整 commit SHA,各 job 只授予最小权限,checkout 不保留凭据。
本地运行
git clone https://github.com/LeilaoMi/hot-news-radar.git
cd hot-news-radar
uv sync --frozen
cp docker/.env.example .env # 按需填写
uv run python -m trendradar # 跑一轮
常用环境变量:
| 变量 | 作用 |
|---|---|
| REPORT_MODE=current\|daily\|incremental | 指定报告模式 |
| SCHEDULE_ENABLED=false | 关闭时间线调度 |
| RENDER_ONLY=true | 只用已有数据渲染 output/html/latest/{mode}.html,不抓取、不调 AI、不推送;无数据时退出码 1 |
| NOTIFICATION_ENABLED=false | 单独关闭推送 |
- 体检:
uv run python -m trendradar --doctor - 测试:
uv run --with pytest pytest(556 个用例) - Lint:
uv run --with ruff ruff check . - 回归:
python scripts/regression_check.py、python scripts/test_injected_js.py - 一键脚本:
setup-windows.bat/setup-mac.sh;本地预览start-http.sh/start-http.bat(默认只监听 127.0.0.1)
Docker 与 MCP
cd docker
cp .env.example .env # MCP 容器必须设置 MCP_AUTH_TOKEN(≥16 位)
docker compose -f docker-compose-build.yml up -d --build
- 默认镜像为本地构建的
trendradar:local/trendradar-mcp:local,可在docker/.env设置TRENDRADAR_IMAGE/TRENDRADAR_MCP_IMAGE改用已发布镜像。 - 两个镜像都以非 root 用户(uid 10001)运行,带 HEALTHCHECK,基础镜像固定 digest。
RUN_MODE=once运行结束后不会被 restart 策略反复拉起;内置报告 Web 服务不列目录、不提供.db文件。- 把
output/挂进持久卷,否则 once、新增检测和 AI 缓存都会在重启后丢失。
MCP Server(mcp_server/,版本见 version_mcp):
| 变量 | 说明 |
|---|---|
| MCP_HOST | HTTP 监听地址,默认 127.0.0.1 |
| MCP_PORT | 宿主机端口,容器内固定 3333 |
| MCP_AUTH_TOKEN | Bearer Token;监听非回环地址时必填,否则拒绝启动 |
| MCP_ALLOWED_HOSTS / MCP_ALLOWED_ORIGINS | 额外允许的 Host / Origin(默认开启 DNS rebinding 防护) |
| MCP_ENABLE_SIDE_EFFECT_TOOLS | 是否开放会抓取、同步、发送的工具 |
stdio 模式下 stdout 只输出 JSON-RPC,日志走 stderr;返回给客户端的错误会脱敏 webhook、token 与密钥。 接入方法见 README-MCP-FAQ.md 与 README-Cherry-Studio.md。
配置详解
所有配置在 config/,下一轮运行自动生效:
| 文件 | 作用 |
|---|---|
| config.yaml | 主配置:平台 / RSS / 存储 / AI / 推送 / 报告样式 |
| timeline.yaml | 调度模板:时段窗口、报告模式、是否分析 / 推送、once |
| frequency_words.txt | 关键词组,当前为空 = 全量模式 |
| ai_analysis_prompt.txt / ai_translation_prompt.txt / ai_dedup_prompt.txt | AI 提示词 |
| ai_filter/ / ai_interests.txt | AI 智能筛选管线提示词与兴趣描述 |
frequency_words.txt 语法:[WORD_GROUPS] 下每组一段(空行分隔),+ 必须词、! 过滤词(全局生效)、
/正则/、=> 别名、@ 上限,\# 转义井号;[GLOBAL_FILTER] 写全局排除词,支持正则。
订阅生成器输出的就是这个格式。
# 关闭某个平台
platforms:
sources:
- id: "weibo"
name: "微博"
enabled: false
# 新增 RSS 源
rss:
feeds:
- id: "my-feed"
name: "我的订阅"
url: "https://example.com/rss.xml"
max_age_days: 1
# AI 预算与缓存
ai:
total_budget_seconds: 480
cache_ttl_days: 7
timeline.yaml 中 collect: false 会跳过该时段的抓取,platforms.enabled: false 只关热榜、RSS 照常;
时间请加引号(如 "06:00"),未加引号会给出提示。
安全设计
- 链接白名单:热榜、RSS(含 JSON Feed)进入 HTML 和推送的所有链接只放行
http/https, 对大小写、实体编码、控制字符混淆都做了检查;外链统一rel="noopener noreferrer"。 - CSP:报告页、RSS 页、AI 日报页带 Content-Security-Poli
Truncated for display — read the full file on GitHub.
Related Skills
Agent-Reach
106.6kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
headroom
78.3kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
CowAgent
47.7kOpen-source personal AI assistant & Agent Harness. Plans tasks, runs tools and skills, self-evolves with memory and knowledge. Multi-agent, multi-model, multi-channel. Lightweight, extensible, one-line install.
Scrapling
90.4k🕷️ The BEST Web Scraping framework that handles everything from a single request to a full-scale crawl! Don't be shy, join here: https://discord.gg/EMgGbDceNQ and follow here for daily tips and tricks: https://x.com/Scrapling_dev
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
