⭐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 等渠道智能推送。
Python aibarkdata-analysisdockerhot-newsllmmailmcpmcp-servernewsntfypythonrsstrending-topicswechatwework
v2.3.2
sansane5835eca58a1
diff --git a/main.py b/main.pyindex 5f8d194364..cf313b8459 100644--- a/main.py+++ b/main.py@@ -20,7 +20,7 @@ import requestsimport yaml-VERSION = "2.3.1"+VERSION = "2.3.2"# === SMTP邮件配置 ===@@ -142,7 +142,7 @@ def load_config():"PLATFORMS": config_data["platforms"],}- # Webhook配置(环境变量优先)+ # 通知渠道配置(环境变量优先)notification = config_data.get("notification", {})webhooks = notification.get("webhooks", {})@@ -180,30 +180,30 @@ def load_config():).strip() or webhooks.get("email_smtp_port", "")# 输出配置来源信息- webhook_sources = []+ notification_sources = []if config["FEISHU_WEBHOOK_URL"]:source = "环境变量" if os.environ.get("FEISHU_WEBHOOK_URL") else "配置文件"- webhook_sources.append(f"飞书({source})")+ notification_sources.append(f"飞书({source})")if config["DINGTALK_WEBHOOK_URL"]:source = "环境变量" if os.environ.get("DINGTALK_WEBHOOK_URL") else "配置文件"- webhook_sources.append(f"钉钉({source})")+ notification_sources.append(f"钉钉({source})")if config["WEWORK_WEBHOOK_URL"]:source = "环境变量" if os.environ.get("WEWORK_WEBHOOK_URL") else "配置文件"- webhook_sources.append(f"企业微信({source})")+ notification_sources.append(f"企业微信({source})")if config["TELEGRAM_BOT_TOKEN"] and config["TELEGRAM_CHAT_ID"]:token_source = ("环境变量" if os.environ.get("TELEGRAM_BOT_TOKEN") else "配置文件")chat_source = "环境变量" if os.environ.get("TELEGRAM_CHAT_ID") else "配置文件"- webhook_sources.append(f"Telegram({token_source}/{chat_source})")+ notification_sources.append(f"Telegram({token_source}/{chat_source})")if config["EMAIL_FROM"] and config["EMAIL_PASSWORD"] and config["EMAIL_TO"]:from_source = "环境变量" if os.environ.get("EMAIL_FROM") else "配置文件"- webhook_sources.append(f"邮件({from_source})")+ notification_sources.append(f"邮件({from_source})")- if webhook_sources:- print(f"Webhook 配置来源: {', '.join(webhook_sources)}")+ if notification_sources:+ print(f"通知渠道配置来源: {', '.join(notification_sources)}")else:- print("未配置任何 Webhook")+ print("未配置任何通知渠道")return config@@ -2910,7 +2910,7 @@ def split_content_into_batches(return batches-def send_to_webhooks(+def send_to_notifications(stats: List[Dict],failed_ids: Optional[List] = None,report_type: str = "当日汇总",@@ -2921,7 +2921,7 @@ def send_to_webhooks(mode: str = "daily",html_file_path: Optional[str] = None,) -> Dict[str, bool]:- """发送数据到多个webhook平台"""+ """发送数据到多个通知平台"""results = {}if CONFIG["SILENT_PUSH"]["ENABLED"]:@@ -2999,7 +2999,7 @@ def send_to_webhooks()if not results:- print("未配置任何webhook URL,跳过通知发送")+ print("未配置任何通知渠道,跳过通知发送")# 如果成功发送了任何通知,且启用了每天只推一次,则记录推送if CONFIG["SILENT_PUSH"]["ENABLED"] and CONFIG["SILENT_PUSH"]["ONCE_PER_DAY"] and any(results.values()):@@ -3500,14 +3500,15 @@ class NewsAnalyzer:"""获取当前模式的策略配置"""return self.MODE_STRATEGIES.get(self.report_mode, self.MODE_STRATEGIES["daily"])- def _has_webhook_configured(self) -> bool:- """检查是否配置了webhook"""+ def _has_notification_configured(self) -> bool:+ """检查是否配置了任何通知渠道"""return any([CONFIG["FEISHU_WEBHOOK_URL"],CONFIG["DINGTALK_WEBHOOK_URL"],CONFIG["WEWORK_WEBHOOK_URL"],(CONFIG["TELEGRAM_BOT_TOKEN"] and CONFIG["TELEGRAM_CHAT_ID"]),+ (CONFIG["EMAIL_FROM"] and CONFIG["EMAIL_PASSWORD"] and CONFIG["EMAIL_TO"]),])@@ -3635,14 +3636,14 @@ class NewsAnalyzer:html_file_path: Optional[str] = None,) -> bool:"""统一的通知发送逻辑,包含所有判断条件"""- has_webhook = self._has_webhook_configured()+ has_notification = self._has_notification_configured()if (CONFIG["ENABLE_NOTIFICATION"]- and has_webhook+ and has_notificationand self._has_valid_content(stats, new_titles)):- send_to_webhooks(+ send_to_notifications(stats,failed_ids or [],report_type,@@ -3654,13 +3655,13 @@ class NewsAnalyzer:html_file_path=html_file_path,)return True- elif CONFIG["ENABLE_NOTIFICATION"] and not has_webhook:- print("⚠️ 警告:通知功能已启用但未配置webhook URL,将跳过通知发送")+ elif CONFIG["ENABLE_NOTIFICATION"] and not has_notification:+ print("⚠️ 警告:通知功能已启用但未配置任何通知渠道,将跳过通知发送")elif not CONFIG["ENABLE_NOTIFICATION"]:print(f"跳过{report_type}通知:通知功能已禁用")elif (CONFIG["ENABLE_NOTIFICATION"]- and has_webhook+ and has_notificationand not self._has_valid_content(stats, new_titles)):mode_strategy = self._get_mode_strategy()@@ -3756,13 +3757,13 @@ class NewsAnalyzer:print("爬虫功能已禁用(ENABLE_CRAWLER=False),程序退出")return- has_webhook = self._has_webhook_configured()+ has_notification = self._has_notification_configured()if not CONFIG["ENABLE_NOTIFICATION"]:print("通知功能已禁用(ENABLE_NOTIFICATION=False),将只进行数据抓取")- elif not has_webhook:- print("未配置任何webhook URL,将只进行数据抓取,不发送通知")+ elif not has_notification:+ print("未配置任何通知渠道,将只进行数据抓取,不发送通知")else:- print("通知功能已启用,将发送webhook通知")+ print("通知功能已启用,将发送通知")mode_strategy = self._get_mode_strategy()print(f"报告模式: {self.report_mode}")diff --git a/readme.md b/readme.mdindex 38c6b9f1b4..e4f9cf4de8 100644--- a/readme.md+++ b/readme.md@@ -9,7 +9,7 @@[](https://github.com/sansan0/TrendRadar/stargazers)[](https://github.com/sansan0/TrendRadar/network/members)[](LICENSE)-[](https://github.com/sansan0/TrendRadar)+[](https://github.com/sansan0/TrendRadar)[](https://work.weixin.qq.com/)[](https://telegram.org/)@@ -23,12 +23,12 @@</div>-> 本项目以轻量,易部署为目标。+> 本项目以轻量,易部署为目标>-> 遇到问题可选择以下 2 种方式获得帮助,[点此跳转到两者的区别](#问题答疑与1元点赞)+> 遇到问题可选以下 2 种方式求助【[两者区别](#问题答疑与1元点赞)】-- **详细问题** → 选择 【[GitHub Issues](https://github.com/sansan0/TrendRadar/issues)】,准备好截图和日志等。-- **快速咨询** → 选择【[硅基茶水间](#问题答疑与1元点赞)】公众号文章留言或私信,尽量说清核心问题。+- **详细问题** → 选择 【[GitHub Issues](https://github.com/sansan0/TrendRadar/issues)】,准备好截图和日志等+- **快速咨询** → 选择【[硅基茶水间](#问题答疑与1元点赞)】公众号文章留言或私信,尽量说清核心问题<details><summary>👉 点击查看<strong>致谢名单</strong> (当前 <strong>🔥24🔥</strong> 位)</summary>@@ -468,6 +468,16 @@ GitHub 一键 Fork 即可使用,无需编程基础。> 挖坑:下一次**新功能**,大概会是 ai 分析功能(●'◡'●)+### 2025/09/26 - v2.3.2++- 修正了邮件通知配置检查被遗漏的问题([#88](https://github.com/sansan0/TrendRadar/issues/88))++**修复说明**:+- 解决了即使正确配置邮件通知,系统仍提示"未配置任何webhook"的问题++<details>+<summary><strong>👉 历史更新</strong></summary>+### 2025/09/22 - v2.3.1- **新增邮件推送功能**,支持将热点新闻报告发送到邮箱@@ -484,9 +494,6 @@ GitHub 一键 Fork 即可使用,无需编程基础。**更新提示**:- 此次更新的内容比较多,如果想升级,建议采用【大版本升级】-<details>-<summary><strong>👉 历史更新</strong></summary>-### 2025/09/17 - v2.2.0- 新增一键保存新闻图片功能,让你轻松分享关注的热点diff --git a/version b/versionindex a6254504e4..e7034819f6 100644--- a/version+++ b/version@@ -1 +1 @@-2.3.1\ No newline at end of file+2.3.2\ No newline at end of file