Skip to content

⭐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 等渠道智能推送。

Add daily report HTML to root directory for GitHub Pages support

sansan7c990420a8f8
diff --git a/main.py b/main.py
index c128badbd0..c2671ea12c 100644
--- a/main.py
+++ b/main.py
@@ -19,7 +19,7 @@ CONFIG = {
"RANK_THRESHOLD": 5, # 排名阈值,决定使用【】还是[]的界限
"USE_PROXY": False, # 是否启用本地代理
"DEFAULT_PROXY": "http://127.0.0.1:10086",
- "CONTINUE_WITHOUT_FEISHU": False, # 控制是否在没有飞书webhook URL时继续执行爬虫, 如果True ,会依然进行爬虫行为,会在github上持续的生成爬取的新闻数据
+ "CONTINUE_WITHOUT_FEISHU": True, # 控制是否在没有飞书webhook URL时继续执行爬虫, 如果True ,会依然进行爬虫行为,会在github上持续的生成爬取的新闻数据
"FEISHU_WEBHOOK_URL": "", # 飞书机器人的webhook URL,大概长这样:https://www.feishu.cn/flow/api/trigger-webhook/xxxx, 默认为空,推荐通过GitHub Secrets设置
}
@@ -673,7 +673,6 @@ class ReportGenerator:
) -> str:
"""
生成HTML报告,包括失败的请求信息
-
Returns:
HTML文件路径
"""
@@ -682,7 +681,6 @@ class ReportGenerator:
filename = "当日统计.html"
else:
filename = f"{TimeHelper.format_time_filename()}.html"
-
file_path = FileHelper.get_output_path("html", filename)
# HTML模板和内容生成
@@ -694,6 +692,15 @@ class ReportGenerator:
with open(file_path, "w", encoding="utf-8") as f:
f.write(html_content)
+ # 如果是当日统计,还需要在根目录下生成index.html
+ if is_daily:
+ root_file_path = "index.html" # 根目录下使用index.html作为文件名
+ with open(root_file_path, "w", encoding="utf-8") as f:
+ f.write(html_content)
+ print(
+ f"当日统计报告已保存到根目录的index.html: {os.path.abspath(root_file_path)}"
+ )
+
return file_path
@staticmethod