⭐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
feat: 新增 Cloudflare Pages 自动部署 & 本地部署(uv) 方案
sansan42e0703d4f32
diff --git a/.github/workflows/crawler.yml b/.github/workflows/crawler.ymlindex d5d009e286..3c5d5b153c 100644--- a/.github/workflows/crawler.yml+++ b/.github/workflows/crawler.yml@@ -168,3 +168,48 @@ jobs:S3_REGION: ${{ secrets.S3_REGION }}GITHUB_ACTIONS: truerun: uv run python -m trendradar++ # --------------------------------------------------------------------------------+ # ☁️ CLOUDFLARE PAGES DEPLOY / 部署到 Cloudflare Pages(可选)+ # --------------------------------------------------------------------------------+ # 将爬虫生成的 index.html 自动部署到 Cloudflare Pages,国内访问比 GitHub Pages 更快。+ # 仅当下面三个 Secrets 均已配置时才会执行,缺任意一个则自动跳过,不影响其它流程:+ # - CLOUDFLARE_API_TOKEN 权限:Account → Cloudflare Pages → Edit+ # - CLOUDFLARE_ACCOUNT_ID Cloudflare 账户 ID+ # - CLOUDFLARE_PROJECT_NAME Cloudflare Pages 项目名(需提前在 Dashboard 创建)+ # 配置教程详见 README「自动部署到 Cloudflare Pages」章节。+ # --------------------------------------------------------------------------------+ - name: Check Cloudflare config+ if: success()+ id: cf_check+ env:+ CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}+ CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}+ CLOUDFLARE_PROJECT_NAME: ${{ secrets.CLOUDFLARE_PROJECT_NAME }}+ run: |+ if [ -n "$CLOUDFLARE_API_TOKEN" ] && [ -n "$CLOUDFLARE_ACCOUNT_ID" ] && [ -n "$CLOUDFLARE_PROJECT_NAME" ]; then+ echo "enabled=true" >> "$GITHUB_OUTPUT"+ echo "✅ 检测到 Cloudflare 配置,准备部署到 Cloudflare Pages"+ else+ echo "enabled=false" >> "$GITHUB_OUTPUT"+ echo "ℹ️ 未配置 Cloudflare Secrets,跳过 Cloudflare Pages 部署"+ fi++ - name: Prepare Cloudflare Pages assets+ if: success() && steps.cf_check.outputs.enabled == 'true'+ run: |+ if [ ! -f index.html ]; then+ echo "❌ 未找到 index.html,请确认爬虫已生成网页报告"+ exit 1+ fi+ rm -rf cloudflare_dist+ mkdir -p cloudflare_dist+ cp index.html cloudflare_dist/index.html++ - name: Deploy to Cloudflare Pages+ if: success() && steps.cf_check.outputs.enabled == 'true'+ uses: cloudflare/wrangler-action@v3+ with:+ apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}+ accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}+ command: pages deploy cloudflare_dist --project-name=${{ secrets.CLOUDFLARE_PROJECT_NAME }}diff --git a/README-EN.md b/README-EN.mdindex ffb1baf932..ff2eaeb1d2 100644--- a/README-EN.md+++ b/README-EN.md@@ -15,8 +15,11 @@ Deploy in <strong>30 seconds</strong> — Say goodbye to endless scrolling, only[](https://github.com/sansan0/TrendRadar)[](https://hub.docker.com/r/wantcat/trendradar)[](https://hub.docker.com/r/wantcat/trendradar-mcp)-[](https://github.com/sansan0/TrendRadar)-[](https://github.com/sansan0/TrendRadar)+[](#rss-feed-support-v450-new)+[](#ai-multi-language-translation-v520-new)+[](#-mcp-clients)+[](#ai-analysis-push-v500-new)+[](#ai-smart-news-filtering-v650-new)[](https://work.weixin.qq.com/)[](https://weixin.qq.com/)@@ -30,12 +33,11 @@ Deploy in <strong>30 seconds</strong> — Say goodbye to endless scrolling, only[](#)-[](https://github.com/sansan0/TrendRadar)+[](#-quick-start)[](https://sansan0.github.io/TrendRadar)-[](https://hub.docker.com/r/wantcat/trendradar)-[](https://modelcontextprotocol.io/)-[](#)-[](#)+[](#6-docker-deployment)+[](#local-deploy)+[](#cloudflare-deploy)</div>@@ -58,7 +60,7 @@ Deploy in <strong>30 seconds</strong> — Say goodbye to endless scrolling, only| | | ||:---:|:---:|:---:|| [🚀 **Quick Start**](#-quick-start) | [AI Analysis](#-ai-analysis) | [⚙️ **Configuration Guide**](#configuration-guide) |-| [Docker Deployment](#6-docker-deployment) | [MCP Clients](#-mcp-clients) | [📝 **Changelog**](#-changelog) |+| [Docker Deployment](#6-docker-deployment) / [Local Deploy](#local-deploy) | [MCP Clients](#-mcp-clients) | [📝 **Changelog**](#-changelog) || [🎯 **Core Features**](#-core-features) | [☕ **Support Project**](#-support-project) | [📚 **Related Projects**](#-related-projects) |</div>@@ -1149,6 +1151,37 @@ After running, the `index.html` generated in the root directory is the complete>> ⚠️ The GitHub Actions auto-storage feature has been discontinued (this approach caused excessive load on GitHub servers, affecting platform stability).+<a id="cloudflare-deploy"></a>++### ☁️ Auto-Deploy to Cloudflare Pages (Optional · Faster Access in China)++GitHub Pages can be slow to access from mainland China, while [Cloudflare Pages](https://pages.cloudflare.com/) offers more friendly access speeds. Once configured, GitHub Actions will automatically push the latest `index.html` to Cloudflare Pages on every run — no manual operation needed.++> **Prerequisite**: You have completed the [GitHub Actions deployment](#-quick-start) and can generate the web report normally.++**① Create a Cloudflare Pages project**++Log in to the [Cloudflare Dashboard](https://dash.cloudflare.com/) → **Workers & Pages** → **Create** → **Pages** → choose **Upload assets**, enter a project name (e.g. `trendradar`, remember it), and upload any file to complete the initial creation (it will be overwritten by Actions later).++**② Get your API Token and Account ID**++- **API Token**: Top-right avatar → **My Profile** → **API Tokens** → **Create Token** → **Create Custom Token**, set permissions to `Account` → `Cloudflare Pages` → `Edit`, then copy the token after creation (shown only once).+- **Account ID**: Found in the right sidebar of the **Workers & Pages** page (or at the bottom-right of any domain's **Overview** page).++**③ Add 3 Secrets to your GitHub repository**++Go to `Settings` → `Secrets and variables` → `Actions` → `New repository secret`, and add the following:++| Name | Secret (Value) |+|:---|:---|+| `CLOUDFLARE_API_TOKEN` | The API Token created above |+| `CLOUDFLARE_ACCOUNT_ID` | Your Cloudflare Account ID |+| `CLOUDFLARE_PROJECT_NAME` | Your Cloudflare Pages project name (e.g. `trendradar`) |++Once configured, the next GitHub Actions run will deploy automatically, accessible at `https://<project-name>.pages.dev`.++> 💡 **Note**: If any of the three secrets is missing, Cloudflare deployment is skipped automatically without affecting news push or other features. To bind a custom domain, configure it under **Custom domains** in your Pages project.+### **Reduce APP Dependencies**Transform from "algorithm recommendation captivity" to "actively getting the information you want"@@ -1171,19 +1204,52 @@ Transform from "algorithm recommendation captivity" to "actively getting the inf### Choose the Deployment Method That Fits You-#### 🅰️ Option A: Docker Deployment (Recommended 🔥)+#### Ⓐ Option A: Docker Deployment (Recommended 🔥)* **Features**: More stable than GitHub Actions* **Best for**: Users with their own server, NAS, or an always-on PC👉 **[Jump to Docker Deployment Tutorial](#6-docker-deployment)**-#### 🅱️ Option B: GitHub Actions Deployment (This Chapter ⬇️)+#### Ⓑ Option B: GitHub Actions Deployment (This Chapter ⬇️)* **Features**: Data is stored in **Remote Cloud Storage** (no longer written to Git repo)* **Storage**: Configure cloud storage service (e.g. Cloudflare R2, Alibaba Cloud OSS, Tencent Cloud COS, etc.)* **Note**: Requires periodic check-in renewal (every 7 days)+<a id="local-deploy"></a>++#### Ⓒ Option C: Local Deployment (uv)++* **Features**: Run directly on your machine, no Docker needed, great for development or Docker-free environments+* **Best for**: Windows / Mac / Linux users (no Python required, uv manages it automatically)+* **Steps**:++ **1. Install uv** (skip if already installed, no Python required)++ ```bash+ # macOS / Linux+ curl -LsSf https://astral.sh/uv/install.sh | sh++ # Windows (PowerShell)+ powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"+ ```++ **2. Clone and run**++ ```bash+ git clone https://github.com/sansan0/TrendRadar.git+ cd TrendRadar+ uv sync # Automatically installs Python and project dependencies+ uv run python -m trendradar+ ```++ > 💡 **Tips**:+ > - uv automatically manages Python versions, no manual Python installation needed+ > - Windows users can also double-click `setup-windows.bat` (or `setup-windows-en.bat`) for one-click setup+ > - Mac users can use `bash setup-mac.sh`+ > - Before running, edit `config/config.yaml` to set up push channels and other settings, refer to the basic configuration flow below+### 1️⃣ Step 1: Get project codeClick the green **[Use this template]** button in the upper right corner of this repository → select "Create a new repository".diff --git a/README.md b/README.mdindex 9928136387..f3107c85ad 100644--- a/README.md+++ b/README.md@@ -16,8 +16,11 @@[](https://github.com/sansan0/TrendRadar)[](https://hub.docker.com/r/wantcat/trendradar)[](https://hub.docker.com/r/wantcat/trendradar-mcp)-[](https://github.com/sansan0/TrendRadar)-[](https://github.com/sansan0/TrendRadar)+[](#rss-订阅源支持v450-新增)+[](#ai-多语言翻译v520-新增)+[](#-mcp-客户端)+[](#ai-分析推送v500-新增)+[](#ai-智能筛选新闻v650-新增)[](https://work.weixin.qq.com/)[](https://weixin.qq.com/)@@ -31,12 +34,11 @@[](#)-[](https://github.com/sansan0/TrendRadar)+[](#-快速开始)[](https://sansan0.github.io/TrendRadar)-[](https://hub.docker.com/r/wantcat/trendradar)-[](https://modelcontextprotocol.io/)-[](#)-[](#)+[](#6-docker-部署)+[](#local-deploy)+[](#cloudflare-deploy)</div>@@ -59,7 +61,7 @@| | | ||:---:|:---:|:---:|| [🚀 **快速开始**](#-快速开始) | [AI 智能分析](#-ai-智能分析) | [⚙️ **配置详解**](#配置详解) |-| [Docker部署](#6-docker-部署) | [MCP客户端](#-mcp-客户端) | [📝 **更新日志**](#-更新日志) |+| [Docker部署](#6-docker-部署) / [本地部署](#local-deploy) | [MCP客户端](#-mcp-客户端) | [📝 **更新日志**](#-更新日志) || [🎯 **核心功能**](#-核心功能) | [☕ **支持项目**](#-支持项目) | [📚 **项目相关**](#-项目相关) |</div>@@ -1204,6 +1206,37 @@ ai_translation:>> ⚠️ 原 GitHub Actions 自动存储功能已下线(该方案曾导致 GitHub 服务器负载过高,影响平台稳定性)。+<a id="cloudflare-deploy"></a>++### ☁️ 自动部署到 Cloudflare Pages(可选 · 国内访问更快)++GitHub Pages 在国内访问较慢,[Cloudflare Pages](https://pages.cloudflare.com/) 的访问速度更友好。配置完成后,GitHub Actions 每次运行都会自动把最新的 `index.html` 推送到 Cloudflare Pages,无需任何手动操作。++> **前置条件**:已完成 [GitHub Actions 部署](#-快速开始) 并能正常生成网页报告。++**① 创建 Cloudflare Pages 项目**++登录 [Cloudflare Dashboard](https://dash.cloudflare.com/) → **Workers & Pages** → **Create** → **Pages** → 选择 **Upload assets(直接上传)**,填写一个项目名称(例如 `trendradar`,请记住它),随意上传一个文件完成首次创建(后续会被 Actions 自动覆盖)。++**② 获取 API Token 与 Account ID**++- **API Token**:右上角头像 → **My Profile** → **API Tokens** → **Create Token** → **Create Custom Token**,权限选择 `Account` → `Cloudflare Pages` → `Edit`,创建后复制 Token(仅显示一次)。+- **Account ID**:在 **Workers & Pages** 页面右侧栏即可找到(或任意域名 **Overview** 页面右下角)。++**③ 在 GitHub 仓库添加 3 个 Secrets**++进入仓库 `Settings` → `Secrets and variables` → `Actions` → `New repository secret`,依次添加:++| Name(名称) | Secret(值) |+|:---|:---|+| `CLOUDFLARE_API_TOKEN` | 上一步创建的 API Token |+| `CLOUDFLARE_ACCOUNT_ID` | 你的 Cloudflare Account ID |+| `CLOUDFLARE_PROJECT_NAME` | Cloudflare Pages 项目名(如 `trendradar`) |++配置完成后,下一次 GitHub Actions 运行即会自动部署,访问地址为 `https://<项目名>.pages.dev`。++> 💡 **说明**:三个 Secret 缺任意一个都会自动跳过 Cloudflare 部署,不会影响新闻推送等其它功能;如需绑定自定义域名,可在 Pages 项目的 **Custom domains** 中设置。+### **减少 APP 依赖**从"被算法推荐绑架"变成"主动获取自己想要的信息"@@ -1226,18 +1259,51 @@ ai_translation:### 请选择适合你的部署方式-#### 🅰️ 方案一:Docker 部署(推荐 🔥)+#### Ⓐ 方案一:Docker 部署(推荐 🔥)* **特点**:比 GitHub Actions 更稳定,数据本地存储(无需配置云存储)* **适用**:有自己的服务器、NAS 或长期运行的电脑* **注意**:你需要阅读了解下方的基础配置流程,然后跳转到 Docker 教程进行部署。-#### 🅱️ 方案二:GitHub Actions 部署(本章节内容 ⬇️)+#### Ⓑ 方案二:GitHub Actions 部署(本章节内容 ⬇️)* **特点**:无服务器,数据存储在 **远程云存储**(推荐配置)* **适用**:没有服务器的用户,利用 GitHub 免费资源* **注意**:需配置云存储以获得完整体验,且需定期签到续期+<a id="local-deploy"></a>++#### Ⓒ 方案三:本地部署(uv)++* **特点**:直接在本机运行,无需 Docker,适合开发调试或无 Docker 环境的用户+* **适用**:Windows / Mac / Linux 用户(无需预装 Python,uv 会自动管理)+* **步骤**:++ **1. 安装 uv**(如已安装可跳过,无需预装 Python)++ ```bash+ # macOS / Linux+ curl -LsSf https://astral.sh/uv/install.sh | sh++ # Windows (PowerShell)+ powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"+ ```++ **2. 克隆并运行**++ ```bash+ git clone https://github.com/sansan0/TrendRadar.git+ cd TrendRadar+ uv sync # 自动安装 Python 和项目依赖+ uv run python -m trendradar+ ```++ > 💡 **提示**:+ > - uv 会自动管理 Python 版本,无需手动安装 Python+ > - Windows 用户也可以双击 `setup-windows.bat` 一键安装依赖+ > - Mac 用户可使用 `bash setup-mac.sh`+ > - 运行前请先编辑 `config/config.yaml` 填写推送渠道等配置,参考下方的基础配置流程+### 1️⃣ 第一步:获取项目代码点击本仓库页面右上角的绿色 **[Use this template]** 按钮 → 选择 "Create a new repository"。diff --git a/requirements.txt b/requirements.txtdeleted file mode 100644index c4214d82a0..0000000000--- a/requirements.txt+++ /dev/null@@ -1,10 +0,0 @@-requests==2.33.0-pytz==2026.1-PyYAML==6.0.3-fastmcp==2.12.5-websockets==13.1-feedparser==6.0.12-boto3==1.42.76-litellm==1.82.6-json-repair==0.58.6-tenacity==8.5.0