๐ Deploy in 30 seconds โ Say goodbye to endless scrolling, only see the news you truly care about
[](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://weixin.qq.com/)
[](https://telegram.org/)
[](#)
[](https://www.feishu.cn/)
[](#)
[](https://github.com/binwiederhier/ntfy)
[](https://github.com/Finb/Bark)
[](https://slack.com/)
[](https://github.com/sansan0/TrendRadar)
[](https://sansan0.github.io/TrendRadar)
[](https://hub.docker.com/r/wantcat/trendradar)
[](https://modelcontextprotocol.io/)
This project is designed to be lightweight and easy to deploy
Default monitoring of 11 mainstream platforms, with support for adding custom platforms.
๐ก For detailed configuration, see Configuration Guide - Platform Configuration
Three Push Modes:
| Mode | Target Users | Push Feature |
|---|---|---|
| Daily Summary (daily) | Managers/Regular Users | Push all matched news of the day (includes previously pushed) |
| Current Rankings (current) | Content Creators | Push current ranking matches (continuously ranked news appear each time) |
| Incremental Monitor (incremental) | Traders/Investors | Push only new content, zero duplication |
๐ก Quick Selection Guide:
- ๐ Don't want duplicate news โ Use
incremental- ๐ Want complete ranking trends โ Use
current- ๐ Need daily summary reports โ Use
dailyFor detailed comparison and configuration, see Configuration Guide - Push Mode Details
Additional Features (Optional):
| Feature | Description | Default |
|---|---|---|
| Push Time Window Control | Set push time range (e.g., 09:00-18:00) to avoid non-work hours notifications | Disabled |
| Content Order Configuration | Adjust display order of "Trending Keywords Stats" and "New Trending News" (v3.5.0 new) | Stats first |
๐ก For detailed configuration, see Configuration Guide - Report Configuration and Configuration Guide - Push Window
Set personal keywords (e.g., AI, BYD, Education Policy) to receive only relevant trending news, filtering out noise.
Basic Syntax (5 types):
+: Narrow scope!: Exclude noise@: Control display count (v3.2.0 new)[GLOBAL_FILTER]: Globally exclude specified content (v3.5.0 new)Advanced Features (v3.2.0 new):
Group-based Management:
๐ก Basic Configuration: Keyword Configuration - Basic Syntax
๐ก Advanced Configuration: Keyword Configuration - Advanced Settings
๐ก You can also skip filtering and receive all trending news (leave frequency_words.txt empty)
Real-time tracking of news popularity changes helps you understand not just "what's trending" but "how trends evolve."
๐ก Push format reference: Configuration Guide - Push Format Reference
No longer controlled by platform algorithms, TrendRadar reorganizes all trending searches:
๐ก Weight adjustment guide: Configuration Guide - Advanced Configuration
Supports WeWork (+ WeChat push solution), Feishu, DingTalk, Telegram, Email, ntfy, Bark, Slack โ messages delivered directly to phone and email.
๐ Multi-Account Push Notes (v3.5.0 New Feature):
; to separate multiple account valuesFEISHU_WEBHOOK_URL Secret value to https://webhook1;https://webhook2Multi-Backend Support:
Data Format Hierarchy:
| Format | Role | Description |
|---|---|---|
| SQLite | Primary storage | Complete data with statistics information |
| TXT | Human-readable backup | Optional text records for manual viewing |
| HTML | Web report | Beautiful visual report (GitHub Pages) |
Data Management Features:
๐ก For storage configuration details, see Configuration Details - Storage Configuration
AI conversational analysis system based on MCP (Model Context Protocol), enabling deep data mining with natural language.
๐ก Usage Tip: AI features require local news data support
- Project includes November 1-15 test data for immediate experience
- Recommend deploying the project yourself to get more real-time data
See AI Analysis for details
One-click GitHub Fork to use, no programming required.
30-second deployment: GitHub Pages (web browsing) supports one-click save as image for easy sharing
1-minute deployment: WeWork (mobile notification)
๐ก Tip: Want a real-time updated web version? After forking, go to your repo Settings โ Pages and enable GitHub Pages. Preview Effect.
Transform from "algorithm recommendation captivity" to "actively getting the information you want"
Target Users: Investors, content creators, PR professionals, news-conscious general users
Typical Scenarios: Stock investment monitoring, brand sentiment tracking, industry trend watching, lifestyle news gathering
| Github Pages Effect (Mobile Adapted, Email Push) | Feishu Push Effect |
|---|---|
![]() |
![]() |
Upgrade Instructions:
- ๐ Check Latest Updates: Original Repository Changelog
- Tip: Do NOT update this project via Sync fork. Check [Changelog] to understand specific [Upgrade Methods] and [Features]
- Major Version Upgrade: Upgrading from v1.x to v2.y, recommend deleting existing fork and re-forking to save effort and avoid config conflicts
MCP Module Update:
sync_from_remote: Pull data from remote storage to localget_storage_status: Get storage configuration and statuslist_available_dates: List available dates in local/remote storage๐ Reminder: Fork users should first check the latest official documentation to ensure the configuration steps are up to date.
v4.0.0 Important Change: Introduced "Activity Detection" mechanismโGitHub Actions now requires periodic check-in to maintain operation.
Actions โ Check In โ Run workflowIn GitHub Actions environment, data is stored in Remote Cloud Storage (supports S3-compatible protocols, Cloudflare R2 recommended for free tier), keeping your repository clean (see Required Configuration: Remote Cloud Storage below).
For long-term stable operation, we recommend Docker Deployment, with data stored locally and no check-in requiredโthough it does require purchasing a cloud server.
Fork this project to your GitHub account
Setup GitHub Secrets (Required + Optional Platforms):
In your forked repo, go to Settings > Secrets and variables > Actions > New repository secret
๐ Important Instructions (Please Read Carefully):
WEWORK_WEBHOOK_URL, FEISHU_WEBHOOK_URL, etc.). Do not modify or create new names arbitrarily, or the system will not recognize them๐ Multi-Account Push Notes (v3.5.0 New Feature):
; to separate multiple account valuesFEISHU_WEBHOOK_URL Secret value to https://webhook1;https://webhook2Multi-Account Configuration Examples:
| Name | Secret (Value) Example |
|------|------------------------|
| FEISHU_WEBHOOK_URL | https://webhook1;https://webhook2;https://webhook3 |
| TELEGRAM_BOT_TOKEN | token1;token2 |
| TELEGRAM_CHAT_ID | chatid1;chatid2 |
| NTFY_TOPIC | topic1;topic2 |
| NTFY_TOKEN | ;token2 (1st has no token, use empty string as placeholder) |
Configuration Example:

As shown above, each row is a configuration item:
WEWORK_WEBHOOK_URL)โ ๏ธ Required Configuration: Remote Cloud Storage (Required for GitHub Actions Environment, Cloudflare R2 Recommended)
GitHub Secret Configuration (โ ๏ธ All 4 configuration items below are required):
| Name | Secret (Value) Description |
|------|----------------------------|
| S3_BUCKET_NAME | Bucket name (e.g., trendradar-data) |
| S3_ACCESS_KEY_ID | Access key ID |
| S3_SECRET_ACCESS_KEY | Access key |
| S3_ENDPOINT_URL | S3 API endpoint (e.g., R2: https://<account-id>.r2.cloudflarestorage.com) |
How to Get Credentials (Using Cloudflare R2 as Example):
R2 in left menu โ Click Create Bucket โ Enter name (e.g., trendradar-data)Manage R2 API Tokens at top right โ Create API TokenObject Read & Write permission โ After creation, it will display Access Key ID and Secret Access Keyhttps://<account-id>.r2.cloudflarestorage.com)Notes:
๐ Click to expand: WeWork Bot (Simplest and fastest configuration)
GitHub Secret Configuration (โ ๏ธ Name must match exactly):
WEWORK_WEBHOOK_URL (Please copy and paste this name, do not type manually to avoid typos)Bot Setup Steps:
#### Mobile Setup:
#### PC Setup Process Similar
๐ Click to expand: Personal WeChat Push (Based on WeWork app, push to personal WeChat)
This solution is based on WeWork's plugin mechanism. The push style is plain text (no markdown format), but it can push directly to personal WeChat without installing WeWork App.
GitHub Secret Configuration (โ ๏ธ Name must match exactly):
WEWORK_WEBHOOK_URL (Please copy and paste this name, do not type manually)Secret (Value): Your WeWork app Webhook address
Name: WEWORK_MSG_TYPE (Please copy and paste this name, do not type manually)
Secret (Value): text
Setup Steps:
WEWORK_MSG_TYPE Secret with value text
Notes:
text for plain text, markdown for rich text (default) ๐ Click to expand: Feishu Bot (Most user-friendly message display)
GitHub Secret Configuration (โ ๏ธ Name must match exactly):
FEISHU_WEBHOOK_URL (Please copy and paste this name, do not type manually)Two methods available, Method 1 is simpler, Method 2 is more complex (but stable push)
Method 1 discovered and suggested by ziventian, thanks to them. Default is personal push, group push can be configured via #97
Method 1:
For some users, additional operations needed to avoid "System Error". Need to search for the bot on mobile and enable Feishu bot application (suggestion from community, can refer)
Open in PC browser https://botbuilder.feishu.cn/home/my-command
Click "New Bot Command"
Click "Select Trigger", scroll down, click "Webhook Trigger"
Now you'll see "Webhook Address", copy this link to local notepad temporarily, continue with next steps
In "Parameters" put the following content, then click "Done"
{
"message_type": "text",
"content": {
"total_titles": "{{Content}}",
"timestamp": "{{Content}}",
"report_type": "{{Content}}",
"text": "{{Content}}"
}
}
Click "Select Action" > "Send via Official Bot"
Message title fill "TrendRadar Trending Monitor"
Most critical part, click + button, select "Webhook Trigger", then arrange as shown in image
FEISHU_WEBHOOK_URLMethod 2:
Open in PC browser https://botbuilder.feishu.cn/home/my-app
Click "New Bot Application"
After entering the created application, click "Process Design" > "Create Process" > "Select Trigger"
Scroll down, click "Webhook Trigger"
Now you'll see "Webhook Address", copy this link to local notepad temporarily, continue with next steps
In "Parameters" put the following content, then click "Done"
{
"message_type": "text",
"content": {
"total_titles": "{{Content}}",
"timestamp": "{{Content}}",
"report_type": "{{Content}}",
"text": "{{Content}}"
}
}
Click "Select Action" > "Send Feishu Message", check "Group Message", then click the input box below, click "Groups I Manage" (if no group, you can create one in Feishu app)
Message title fill "TrendRadar Trending Monitor"
Most critical part, click + button, select "Webhook Trigger", then arrange as shown in image
FEISHU_WEBHOOK_URL ๐ Click to expand: DingTalk Bot
GitHub Secret Configuration (โ ๏ธ Name must match exactly):
DINGTALK_WEBHOOK_URL (Please copy and paste this name, do not type manually)Bot Setup Steps:
Create Bot (PC Only):
Configure Bot:
Complete Setup:
DINGTALK_WEBHOOK_URLNote: Mobile can only receive messages, cannot create new bots.
๐ Click to expand: Telegram Bot
GitHub Secret Configuration (โ ๏ธ Name must match exactly):
TELEGRAM_BOT_TOKEN (Please copy and paste this name, do not type manually)Secret (Value): Your Telegram Bot Token
Name: TELEGRAM_CHAT_ID (Please copy and paste this name, do not type manually)
Secret (Value): Your Telegram Chat ID
Note: Telegram requires two Secrets, please click "New repository secret" button twice to add them separately
Bot Setup Steps:
Create Bot:
@BotFather in Telegram (note case, has blue verification checkmark, shows ~37849827 monthly users, this is official, beware of fake accounts)/newbot command to create new bot123456789:AAHfiqksKZ8WmR2zSjiQ7_v4TMAKdiHm9T0)Get Chat ID:
Method 1: Via Official API
https://api.telegram.org/bot<Your Bot Token>/getUpdates"chat":{"id":number} in returned JSONMethod 2: Using Third-Party Tool
@userinfobot and send /startConfigure to GitHub:
TELEGRAM_BOT_TOKEN: Fill in Bot Token from step 1TELEGRAM_CHAT_ID: Fill in Chat ID from step 2
๐ Click to expand: Email Push (Supports all mainstream email providers)
โ ๏ธ Important Configuration Dependency: Email push requires HTML report file. Make sure
formats.htmlis set totrueinconfig/config.yaml:> formats: > sqlite: true > txt: false > html: true # Must be enabled, otherwise email push will fail > ``` > If set to `false`, email push will report error: `Error: HTML file does not exist or not provided: None` <br> **GitHub Secret Configuration (โ ๏ธ Name must match exactly):** - **Name**: `EMAIL_FROM` (Please copy and paste this name, do not type manually) - **Secret (Value)**: Sender email address - **Name**: `EMAIL_PASSWORD` (Please copy and paste this name, do not type manually) - **Secret (Value)**: Email password or authorization code - **Name**: `EMAIL_TO` (Please copy and paste this name, do not type manually) - **Secret (Value)**: Recipient email address (multiple separated by comma, or can be same as EMAIL_FROM to send to yourself) - **Name**: `EMAIL_SMTP_SERVER` (Optional, please copy and paste this name) - **Secret (Value)**: SMTP server address (leave empty for auto-detection) - **Name**: `EMAIL_SMTP_PORT` (Optional, please copy and paste this name) - **Secret (Value)**: SMTP port (leave empty for auto-detection) **Note**: Email push requires at least **3 required** Secrets (EMAIL_FROM, EMAIL_PASSWORD, EMAIL_TO), the last two are optional <br> **Supported Email Providers** (Auto-detect SMTP config): | Provider | Domain | SMTP Server | Port | Encryption | |----------|--------|-------------|------|-----------| | **Gmail** | gmail.com | smtp.gmail.com | 587 | TLS | | **QQ Mail** | qq.com | smtp.qq.com | 465 | SSL | | **Outlook** | outlook.com | smtp-mail.outlook.com | 587 | TLS | | **Hotmail** | hotmail.com | smtp-mail.outlook.com | 587 | TLS | | **Live** | live.com | smtp-mail.outlook.com | 587 | TLS | | **163 Mail** | 163.com | smtp.163.com | 465 | SSL | | **126 Mail** | 126.com | smtp.126.com | 465 | SSL | | **Sina Mail** | sina.com | smtp.sina.com | 465 | SSL | | **Sohu Mail** | sohu.com | smtp.sohu.com | 465 | SSL | | **189 Mail** | 189.cn | smtp.189.cn | 465 | SSL | | **Aliyun Mail** | aliyun.com | smtp.aliyun.com | 465 | TLS | > **Auto-detect**: When using above emails, no need to manually configure `EMAIL_SMTP_SERVER` and `EMAIL_SMTP_PORT`, system auto-detects. > > **Feedback Notice**: > - If you successfully test with **other email providers**, please open an [Issue](https://github.com/sansan0/TrendRadar/issues) to let us know, we'll add to support list > - If above email configurations are incorrect or unusable, please also open an [Issue](https://github.com/sansan0/TrendRadar/issues) for feedback to help improve the project > > **Special Thanks**: > - Thanks to [@DYZYD](https://github.com/DYZYD) for contributing 189 Mail (189.cn) configuration and completing self-send-receive testing ([#291](https://github.com/sansan0/TrendRadar/issues/291)) > - Thanks to [@longzhenren](https://github.com/longzhenren) for contributing Aliyun Mail (aliyun.com) configuration and completing testing ([#344](https://github.com/sansan0/TrendRadar/issues/344)) **Common Email Settings:** #### QQ Mail: 1. Login QQ Mail web version โ Settings โ Account 2. Enable POP3/SMTP service 3. Generate authorization code (16-letter code) 4. `EMAIL_PASSWORD` fill authorization code, not QQ password #### Gmail: 1. Enable two-step verification 2. Generate app-specific password 3. `EMAIL_PASSWORD` fill app-specific password #### 163/126 Mail: 1. Login web version โ Settings โ POP3/SMTP/IMAP 2. Enable SMTP service 3. Set client authorization code 4. `EMAIL_PASSWORD` fill authorization code <br> **Advanced Configuration**: If auto-detect fails, manually configure SMTP: - `EMAIL_SMTP_SERVER`: Like smtp.gmail.com - `EMAIL_SMTP_PORT`: Like 587 (TLS) or 465 (SSL) <br> **Multiple Recipients (note: English comma separator)**: - EMAIL_TO="user1@example.com,user2@example.com,user3@example.com" </details> <details> <summary> <strong>๐ Click to expand: ntfy Push</strong> (Open-source, free, self-hostable)</summary> <br> **Two Usage Methods:** ### Method 1: Free Use (Recommended for Beginners) ๐ **Features**: - โ No account registration, use immediately - โ 250 messages/day (enough for 90% users) - โ Topic name is "password" (need to choose hard-to-guess name) - โ ๏ธ Messages unencrypted, not for sensitive info, but suitable for our non-sensitive project info **Quick Start:** 1. **Download ntfy App**: - Android: [Google Play](https://play.google.com/store/apps/details?id=io.heckel.ntfy) / [F-Droid](https://f-droid.org/en/packages/io.heckel.ntfy/) - iOS: [App Store](https://apps.apple.com/us/app/ntfy/id1625396347) - Desktop: Visit [ntfy.sh](https://ntfy.sh) 2. **Subscribe to Topic** (choose a hard-to-guess name): ``` Suggested format: trendradar-{your initials}-{random numbers} Cannot use Chinese โ Good example: trendradar-zs-8492 โ Bad example: news, alerts (too easy to guess) ``` 3. **Configure GitHub Secret (โ ๏ธ Name must match exactly)**: - **Name**: `NTFY_TOPIC` (Please copy and paste this name, do not type manually) - **Secret (Value)**: Fill in your subscribed topic name - **Name**: `NTFY_SERVER_URL` (Optional, please copy and paste this name) - **Secret (Value)**: Leave empty (default uses ntfy.sh) - **Name**: `NTFY_TOKEN` (Optional, please copy and paste this name) - **Secret (Value)**: Leave empty **Note**: ntfy requires at least 1 required Secret (NTFY_TOPIC), the last two are optional 4. **Test**: ```bash curl -d "Test message" ntfy.sh/your-topic-name ``` --- ### Method 2: Self-Hosting (Complete Privacy Control) ๐ **Target Users**: Have server, pursue complete privacy, strong technical ability **Advantages**: - โ Completely open-source (Apache 2.0 + GPLv2) - โ Complete data self-control - โ No restrictions - โ Zero cost **Docker One-Click Deploy**:bash docker run -d
--name ntfy \ -p 80:80 \ -v /var/cache/ntfy:/var/cache/ntfy \ binwiederhier/ntfy \ serve --cache-file /var/cache/ntfy/cache.db**Configure TrendRadar**:yaml NTFY_SERVER_URL: https://ntfy.yourdomain.com NTFY_TOPIC: trendradar-alerts # Self-hosting can use simple name NTFY_TOKEN: tk_your_token # Optional: Enable access control
**Subscribe in App**: - Click "Use another server" - Enter your server address - Enter topic name - (Optional) Enter login credentials --- **FAQ:** <details> <summary><strong>Q1: Is the free version enough?</strong></summary> 250 messages/day is enough for most users. With 30-minute crawl intervals, about 48 pushes/day, completely sufficient. </details> <details> <summary><strong>Q2: Is the Topic name really secure?</strong></summary> If you choose a random, sufficiently long name (like `trendradar-zs-8492-news`), brute force is nearly impossible: - ntfy has strict rate limiting (1 request/second) - 64 character choices (A-Z, a-z, 0-9, _, -) - 10 random characters have 64^10 possibilities (would take years to crack) </details> --- **Recommended Choice:** | User Type | Recommended | Reason | |-----------|-------------|--------| | Regular Users | Method 1 (Free) | Simple, fast, enough | | Technical Users | Method 2 (Self-Host) | Complete control, unlimited | | High-Frequency Users | Method 3 (Paid) | Check official website | **Related Links:** - [ntfy Official Docs](https://docs.ntfy.sh/) - [Self-Hosting Tutorial](https://docs.ntfy.sh/install/) - [GitHub Repository](https://github.com/binwiederhier/ntfy) </details> <details> <summary>๐ Click to expand: <strong>Bark Push</strong> (iOS exclusive, clean & efficient)</summary> <br> **GitHub Secret Configuration (โ ๏ธ Name must be exact):** - **Name**: `BARK_URL` (copy and paste this name, don't type manually) - **Secret**: Your Bark push URL <br> **Bark Introduction:** Bark is a free open-source push tool for iOS platform, featuring simplicity, speed, and no ads. **Usage Methods:** ### Method 1: Use Official Server (Recommended for beginners) ๐ 1. **Download Bark App**: - iOS: [App Store](https://apps.apple.com/us/app/bark-customed-notifications/id1403753865) 2. **Get Push URL**: - Open Bark App - Copy the push URL displayed on the home page (format: `https://api.day.app/your_device_key`) - Configure the URL to GitHub Secrets as `BARK_URL` ### Method 2: Self-Hosted Server (Complete Privacy Control) ๐ **Suitable for**: Users with servers, pursuing complete privacy, strong technical skills **Docker One-Click Deployment**:bash docker run -d
--name bark-server \ -p 8080:8080 \ finab/bark-server**Configure TrendRadar**:yaml BARK_URL: http://your-server-ip:8080/your_device_key
--- **Notes:** - โ Bark uses APNs push, max 4KB per message - โ Supports automatic batch sending, no worry about long messages - โ Push format is plain text (automatically removes Markdown syntax) - โ ๏ธ Only supports iOS platform **Related Links:** - [Bark Official Website](https://bark.day.app/) - [Bark GitHub Repository](https://github.com/Finb/Bark) - [Bark Server Self-Hosting Tutorial](https://github.com/Finb/bark-server) </details> <details> <summary>๐ Click to expand: <strong>Slack Push</strong></summary> <br> **GitHub Secret Configuration (โ ๏ธ Name must be exact):** - **Name**: `SLACK_WEBHOOK_URL` (copy and paste this name, don't type manually) - **Secret**: Your Slack Incoming Webhook URL <br> **Slack Introduction:** Slack is a team collaboration tool, Incoming Webhooks can push messages to Slack channels. **Setup Steps:** ### Step 1: Create Slack App 1. **Visit Slack API Page**: - Open https://api.slack.com/apps?new_app=1 - Login to your Slack workspace if not logged in 2. **Choose Creation Method**: - Click **"From scratch"** 3. **Fill in App Information**: - **App Name**: Enter app name (e.g., `TrendRadar` or `Hot News Monitor`) - **Workspace**: Select your workspace from dropdown - Click **"Create App"** button ### Step 2: Enable Incoming Webhooks 1. **Navigate to Incoming Webhooks**: - Find and click **"Incoming Webhooks"** in left menu 2. **Enable Feature**: - Find **"Activate Incoming Webhooks"** toggle - Switch from `OFF` to `ON` - Page will auto-refresh showing new configuration options ### Step 3: Generate Webhook URL 1. **Add New Webhook**: - Scroll to page bottom - Click **"Add New Webhook to Workspace"** button 2. **Select Target Channel**: - System will show authorization page - Select channel to receive messages from dropdown (e.g., `#hot-news`) - โ ๏ธ For private channels, must join the channel first 3. **Authorize App**: - Click **"Allow"** button to complete authorization - System will auto-redirect back to config page ### Step 4: Copy and Save Webhook URL 1. **View Generated URL**: - In "Webhook URLs for Your Workspace" section - You'll see the newly generated Webhook URL - Format: `https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX` 2. **Copy URL**: - Click **"Copy"** button on the right of URL - Or manually select and copy URL 3. **Configure to TrendRadar**: - **GitHub Actions**: Add URL to GitHub Secrets as `SLACK_WEBHOOK_URL` - **Local Testing**: Fill URL in `config/config.yaml` `slack_webhook_url` field - **Docker Deployment**: Add URL to `docker/.env` file as `SLACK_WEBHOOK_URL` variable --- **Notes:** - โ Supports Markdown format (auto-converts to Slack mrkdwn) - โ Supports automatic batch sending (4KB per batch) - โ Suitable for team collaboration, centralized message management - โ ๏ธ Webhook URL contains secret key, never make it public **Message Format Preview:**[Batch 1/2]
๐ Trending Topics Statistics
๐ฅ [1/3] AI ChatGPT : 2 articles
1. [Baidu Hot] ๐ ChatGPT-5 Official Release *[1]* - 09:15 (1 time)
2. [Toutiao] AI Chip Stocks Surge *[3]* - [08:30 ~ 10:45] (3 times)
**Related Links:**
- [Slack Incoming Webhooks Official Docs](https://api.slack.com/messaging/webhooks)
- [Slack API App Management](https://api.slack.com/apps)
</details>
> **๐ก Beginner Quick Start Tip**:
>
> For first deployment, suggest completing **GitHub Secrets** configuration first (choose one push platform), then jump to [Step 3] to test push success.
>
> **Don't modify** `config/config.yaml` and `frequency_words.txt` temporarily, adjust these configs after push test succeeds as needed.
3. **Manual Test News Push**:
> ๐ก **Complete Step 1-2 first, then test immediately!** Test success first, then adjust configuration (Step 4) as needed.
>
> โ ๏ธ **IMPORTANT: Enter your own forked project, not this project!**
**How to find your Actions page**:
- **Method 1**: Open your forked project homepage, click the **Actions** tab at the top
- **Method 2**: Direct access `https://github.com/YourUsername/TrendRadar/actions`
**Example comparison**:
- โ Author's project: `https://github.com/sansan0/TrendRadar/actions`
- โ
Your project: `https://github.com/YourUsername/TrendRadar/actions`
**Testing steps**:
1. Enter your project's Actions page
2. Find **"Hot News Crawler"** and click in
- If you don't see this text, refer to [#109](https://github.com/sansan0/TrendRadar/issues/109) to solve
3. Click **"Run workflow"** button on the right to run
4. Wait about 1 minute, messages will be pushed to your configured platform
> โฑ๏ธ **Testing Tips**:
> - Don't test too frequently to avoid triggering GitHub Actions limits
> - After clicking Run workflow, you need to **refresh the browser page** to see the new run record
4. **Configuration Notes (Optional)**:
> ๐ก **Default configuration works normally**, only adjust if you need personalization, understand these three files:
| File | Purpose |
|------|---------|
| `config/config.yaml` | Main config file: push mode, time window, platform list, hotspot weights, etc. |
| `config/frequency_words.txt` | Keyword file: set your interested keywords, filter push content |
| `.github/workflows/crawler.yml` | Execution frequency: control how often to run (โ ๏ธ modify carefully) |
๐ **Detailed Configuration Tutorial**: [Configuration Guide](#configuration-guide)
5. **๐ Deployment Success! Share Your Experience**
Congratulations on completing TrendRadar configuration! You can now start tracking trending news.
๐ฌ **Join our community to share your experience~**
- Want to learn more tips and advanced techniques?
- Need quick help with issues?
- Have great ideas to share?
๐ **Follow our WeChat Official Accountใ็ก
ๅบ่ถๆฐด้ดใ(Silicon Tea Room)**, your likes and comments are the driving force for continuous updates!
For detailed communication methods, please check โ [FAQ & Support](#-faq--support)
6. **๐ค Want Smarter Analysis? Try AI-Enhanced Features** (Optional)
Basic configuration already meets daily needs, but if you want:
- ๐ Let AI automatically analyze trending topics and data insights
- ๐ Search and query news using natural language
- ๐ก Get sentiment analysis, topic prediction, and deep analytics
- โก Directly access data in AI tools like Claude, Cursor, etc.
๐ **Learn More**: [AI Analysis](#-ai-analysis) โ Unlock hidden capabilities and make trend tracking more efficient!
<br>
<a name="configuration-guide"></a>
## โ๏ธ Configuration Guide
> **๐ Reminder**: This chapter provides detailed configuration explanations. Suggest completing [Quick Start](#-quick-start) basic configuration first, then refer to detailed options here as needed.
### 1. Platform Configuration
<details id="custom-monitoring-platforms">
<summary>๐ Click to expand: <strong>Custom Monitoring Platforms</strong></summary>
<br>
**Configuration Location:** `platforms` section in `config/config.yaml`
This project's news data comes from [newsnow](https://github.com/ourongxing/newsnow). You can click the [website](https://newsnow.busiyi.world/), click [More], to see if there are platforms you want.
For specific additions, visit [project source code](https://github.com/ourongxing/newsnow/tree/main/server/sources), based on the file names there, modify the `platforms` configuration in `config/config.yaml` file:
yaml platforms:
id: "wallstreetcn-hot" name: "Wallstreetcn"
> ๐ก **Shortcut**: If you don't know how to read source code, you can copy from others' organized [Platform Configuration Summary](https://github.com/sansan0/TrendRadar/issues/95)
> โ ๏ธ **Note**: More platforms is not always better, suggest choosing 10-15 core platforms. Too many platforms will cause information overload and actually reduce user experience.
</details>
### 2. Keyword Configuration
**Configuration Location:** `config/frequency_words.txt`
Configure monitoring keywords in `frequency_words.txt` with five syntax types, region markers, and grouping features.
| Syntax Type | Symbol | Purpose | Example | Matching Logic |
|------------|--------|---------|---------|----------------|
| **Normal** | None | Basic matching | `Huawei` | Match any one |
| **Required** | `+` | Scope limiting | `+phone` | Must include both |
| **Filter** | `!` | Noise exclusion | `!ad` | Exclude if included |
| **Count Limit** | `@` | Control display count | `@10` | Max 10 news (v3.2.0 new) |
| **Global Filter** | `[GLOBAL_FILTER]` | Globally exclude content | See example below | Filter under any circumstances (v3.5.0 new) |
#### 2.1 Basic Syntax
<a name="keyword-basic-syntax"></a>
<details>
<summary>๐ Click to expand: <strong>Basic Syntax Tutorial</strong></summary>
<br>
##### 1. **Normal Keywords** - Basic Matching
txt
Huawei OPPO Apple
**Effect:** News containing **any one** of these words will be captured
##### 2. **Required Words** `+word` - Scope Limiting
txt Huawei OPPO +phone
**Effect:** Must include both normal word **and** required word to be captured
##### 3. **Filter Words** `!word` - Noise Exclusion
txt Apple Huawei !fruit !price
**Effect:** News containing filter words will be **excluded**, even if it contains keywords
##### 4. **Count Limit** `@number` - Control Display Count (v3.2.0 new)
txt Tesla Musk @5
**Effect:** Limit maximum news count for this keyword group
**Priority:** `@number` > Global config > Unlimited
##### 5. **Global Filter** `[GLOBAL_FILTER]` - Globally Exclude Content (v3.5.0 new)
txt [GLOBAL_FILTER] advertisement promotion marketing shocking clickbait
[WORD_GROUPS] technology AI
Huawei HarmonyOS !car
**Effect:** Filters news containing specified words under **any circumstances**, with **highest priority**
**Use Cases:**
- Filter low-quality content: shocking, clickbait, breaking news, etc.
- Filter marketing content: advertisement, promotion, sponsorship, etc.
- Filter specific topics: entertainment, gossip (based on needs)
**Filter Priority:** Global Filter > Group Filter(`!`) > Group Matching
**Region Markers:**
- `[GLOBAL_FILTER]`: Global filter region, words are filtered under any circumstances
- `[WORD_GROUPS]`: Keyword groups region, maintains existing syntax (`!`, `+`, `@`)
- If no region markers are used, all content is treated as keyword groups (backward compatible)
**Matching Examples:**
txt [GLOBAL_FILTER] advertisement
[WORD_GROUPS] technology AI
- โ "Advertisement: Latest tech product launch" โ Contains global filter word "advertisement", rejected
- โ
"Tech company launches new AI product" โ No global filter words, matches "technology" group
- โ
"AI technology breakthrough draws attention" โ No global filter words, matches "AI" in "technology" group
**Important Notes:**
- Use global filter words carefully to avoid over-filtering and missing valuable content
- Recommended to keep global filter words under 5-15
- For group-specific filtering, prioritize using group filter words (`!` prefix)
---
#### ๐ Group Feature - Importance of Empty Lines
**Core Rule:** Use **empty lines** to separate different groups, each group is independently counted
##### Example Configuration:
txt iPhone Huawei OPPO +launch
A-shares Shanghai Index Shenzhen Index +fluctuation !prediction
World Cup Euro Cup Asian Cup +match
##### Group Explanation and Matching Effects:
**Group 1 - Phone Launches:**
- Keywords: iPhone, Huawei, OPPO
- Required: launch
- Effect: Must include phone brand name and "launch"
**Matching Examples:**
- โ
"iPhone 15 officially launched with pricing" โ Has "iPhone" + "launch"
- โ
"Huawei Mate60 series launch livestream" โ Has "Huawei" + "launch"
- โ
"OPPO Find X7 launch date confirmed" โ Has "OPPO" + "launch"
- โ "iPhone sales hit record high" โ Has "iPhone" but missing "launch"
**Group 2 - Stock Market:**
- Keywords: A-shares, Shanghai Index, Shenzhen Index
- Required: fluctuation
- Filter: prediction
- Effect: Include stock-related words and "fluctuation", but exclude "prediction"
**Matching Examples:**
- โ
"A-shares major fluctuation analysis today" โ Has "A-shares" + "fluctuation"
- โ
"Shanghai Index fluctuation reasons explained" โ Has "Shanghai Index" + "fluctuation"
- โ "Experts predict A-shares fluctuation trends" โ Has "A-shares" + "fluctuation" but contains "prediction"
- โ "A-shares trading volume hits new high" โ Has "A-shares" but missing "fluctuation"
**Group 3 - Football Events:**
- Keywords: World Cup, Euro Cup, Asian Cup
- Required: match
- Effect: Must include cup name and "match"
**Matching Examples:**
- โ
"World Cup group stage match results" โ Has "World Cup" + "match"
- โ
"Euro Cup final match time" โ Has "Euro Cup" + "match"
- โ "World Cup tickets on sale" โ Has "World Cup" but missing "match"
#### ๐ฏ Configuration Tips
##### 1. **From Broad to Strict Strategy**
txt
Artificial Intelligence AI ChatGPT
Artificial Intelligence AI ChatGPT +technology
Artificial Intelligence AI ChatGPT +technology !advertisement !training
##### 2. **Avoid Over-Complexity**
โ **Not Recommended:** Too many words in one group
txt Huawei OPPO Apple Samsung vivo OnePlus Meizu +phone +launch +sales !fake !repair !second-hand
**Recommended:** Split into precise groups
txt Huawei OPPO +new product
Apple Samsung +launch
phone sales +market
</details>
#### 2.2 Advanced Settings (v3.2.0 new)
<a name="keyword-advanced-settings"></a>
<details>
<summary>๐ Click to expand: <strong>Advanced Settings Tutorial</strong></summary>
<br>
##### Keyword Sorting Priority
**Config Location:** `config/config.yaml`
yaml report: sort_by_position_first: false # Sorting priority config
| Value | Sorting Rule | Use Case |
|-------|-------------|----------|
| `false` (default) | News count โ โ Config position โ | Focus on popularity trends |
| `true` | Config position โ โ News count โ | Focus on personal priority |
**Example:** Config order A, B, C, news count A(3), B(10), C(5)
- `false`: B(10) โ C(5) โ A(3)
- `true`: A(3) โ B(10) โ C(5)
##### Global Display Count Limit
yaml report: max_news_per_keyword: 10 # Max 10 per keyword (0=unlimited)
**Docker Environment Variables:**
bash SORT_BY_POSITION_FIRST=true MAX_NEWS_PER_KEYWORD=10
**Combined Example:**
yaml
report: sort_by_position_first: true # Config order priority max_news_per_keyword: 10 # Global default max 10 per keyword
txt
Tesla Musk @20 # Key focus, show 20 (override global)
Huawei # Use global config, show 10
BYD @5 # Limit to 5
**Final Effect:** Display in config order: Tesla(20) โ Huawei(10) โ BYD(5)
</details>
### 3. Push Mode Details
<details>
<summary>๐ Click to expand: <strong>Three Push Modes Detailed Comparison</strong></summary>
<br>
**Configuration Location:** `report.mode` in `config/config.yaml`
yaml report: mode: "daily" # Options: "daily" | "incremental" | "current"
**Docker Environment Variable:** `REPORT_MODE=incremental`
#### Detailed Comparison Table
| Mode | Target Users | Push Timing | Display Content | Typical Use Case |
|------|----------|----------|----------|--------------|
| **Daily Summary**<br/>`daily` | ๐ Managers/Regular Users | Scheduled push (default hourly) | All matched news of the day<br/>+ New news section | **Example**: Check all important news of the day at 6 PM<br/>**Feature**: See full-day trend, don't miss any hot topic<br/>**Note**: Will include previously pushed news |
| **Current Rankings**<br/>`current` | ๐ฐ Content Creators | Scheduled push (default hourly) | Current ranking matches<br/>+ New news section | **Example**: Track "which topics are hottest now" hourly<br/>**Feature**: Real-time understanding of current popularity ranking changes<br/>**Note**: Continuously ranked news appear each time |
| **Incremental Monitor**<br/>`incremental` | ๐ Traders/Investors | Push only when new | Newly appeared frequency word matches | **Example**: Monitor "Tesla", only notify when new news appears<br/>**Feature**: Zero duplication, only see first-time news<br/>**Suitable for**: High-frequency monitoring, avoid information disturbance |
#### Actual Push Effect Example
Assume you monitor "Apple" keyword, execute once per hour:
| Time | daily Mode Push | current Mode Push | incremental Mode Push |
|-----|--------------|----------------|-------------------|
| 10:00 | News A, News B | News A, News B | News A, News B |
| 11:00 | News A, News B, News C | News B, News C, News D | **Only** News C |
| 12:00 | News A, News B, News C | News C, News D, News E | **Only** News D, News E |
**Explanation**:
- `daily`: Cumulative display of all news of the day (A, B, C all retained)
- `current`: Display current ranking news (ranking changed, News D on list, News A off list)
- `incremental`: **Only push newly appeared news** (avoid duplicate disturbance)
#### Common Questions
> **๐ก Encountered this problem?** ๐ "Execute once per hour, news output in first execution still appears in next hour execution"
> - **Reason**: You might have selected `daily` (Daily Summary) or `current` (Current Rankings) mode
> - **Solution**: Change to `incremental` (Incremental Monitor) mode, only push new content
#### โ ๏ธ Incremental Mode Important Notice
> **Users who selected `incremental` (Incremental Monitor) mode, please note:**
>
> ๐ **Incremental mode only pushes when there are new matching news**
>
> **If you haven't received push notifications for a long time, it may be because:**
> 1. No new hot topics matching your keywords in current time period
> 2. Keyword configuration is too strict or too broad
> 3. Too few monitoring platforms
>
> **Solutions:**
> - Solution 1: ๐ [Optimize Keyword Configuration](#2-keyword-configuration) - Adjust keyword precision, add or modify monitoring keywords
> - Solution 2: Switch push mode - Change to `current` or `daily` mode for scheduled push notifications
> - Solution 3: ๐ [Add More Platforms](#1-platform-configuration) - Add more news platforms to expand information sources
</details>
### 4. Advanced Configuration - Hotspot Weight Adjustment
<details>
<summary>๐ Click to expand: <strong>Hotspot Weight Adjustment</strong></summary>
<br>
**Configuration Location:** `weight` section in `config/config.yaml`
yaml weight: rank_weight: 0.6 # Ranking weight frequency_weight: 0.3 # Frequency weight hotness_weight: 0.1 # Hotness weight
Current default configuration is balanced.
#### Two Core Scenarios
**Real-Time Trending Type**:
yaml weight: rank_weight: 0.8 # Mainly focus on ranking frequency_weight: 0.1 # Less concern about continuity hotness_weight: 0.1
**Target Users**: Content creators, marketers, users wanting to quickly understand current hot topics
**In-Depth Topic Type**:
yaml weight: rank_weight: 0.4 # Moderate ranking focus frequency_weight: 0.5 # Emphasize sustained heat within the day hotness_weight: 0.1
**Target Users**: Investors, researchers, journalists, users needing deep trend analysis
#### Adjustment Method
1. **Three numbers must sum to 1.0**
2. **Increase what's important**: Increase rank_weight for rankings, frequency_weight for continuity
3. **Suggest adjusting 0.1-0.2 at a time**, observe effects
Core idea: Users pursuing speed and timeliness increase ranking weight, users pursuing depth and stability increase frequency weight.
</details>
### 5. Push Format Reference
<details>
<summary>๐ Click to expand: <strong>Push Format Explanation</strong></summary>
<br>
#### Push Example
๐ Trending Keywords Stats
๐ฅ [1/3] AI ChatGPT : 2 items
1. [Baidu Hot] ๐ ChatGPT-5 officially launched [**1**] - 09:15 (1 time)
2. [Toutiao] AI chip concept stocks surge [**3**] - [08:30 ~ 10:45] (3 times)
โโโโโโโโโโโโโโโโโโโ
๐ [2/3] BYD Tesla : 2 items
1. [Weibo] ๐ BYD monthly sales break record [**2**] - 10:20 (1 time)
2. [Douyin] Tesla price reduction promotion [**4**] - [07:45 ~ 09:15] (2 times)
โโโโโโโโโโโโโโโโโโโ
๐ [3/3] A-shares Stock Market : 1 item
1. [Wallstreetcn] A-shares midday review [**5**] - [11:30 ~ 12:00] (2 times)
๐ New Trending News (Total 2 items)
**Baidu Hot** (1 item):
1. ChatGPT-5 officially launched [**1**]
**Weibo** (1 item):
1. BYD monthly sales break record [**2**]
Updated: 2025-01-15 12:30:15
#### Message Format Explanation
| Format Element | Example | Meaning | Description |
| ------------- | ------- | -------- | ----------- |
| ๐ฅ๐๐ | ๐ฅ [1/3] AI ChatGPT | Popularity Level | ๐ฅ High (โฅ10) ๐ Medium (5-9) ๐ Normal (<5) |
| [Number/Total] | [1/3] | Rank Position | Current group rank among all matches |
| Keyword Group | AI ChatGPT | Keyword Group | Group from config, title must contain words |
| : N items | : 2 items | Match Count | Total news matching this group |
| [Platform] | [Baidu Hot] | Source Platform | Platform name of the news |
| ๐ | ๐ ChatGPT-5 officially launched | New Mark | First appearance in this round |
| [**number**] | [**1**] | High Rank | Rank โค threshold, bold red display |
| [number] | [7] | Normal Rank | Rank > threshold, normal display |
| - time | - 09:15 | First Time | Time when news was first discovered |
| [time~time] | [08:30 ~ 10:45] | Duration | Time range from first to last appearance |
| (N times) | (3 times) | Frequency | Total appearances during monitoring |
| **New Section** | ๐ **New Trending News** | New Topic Summary | Separately shows newly appeared topics |
</details>
### 6. Docker Deployment
<details>
<summary>๐ Click to expand: <strong>Complete Docker Deployment Guide</strong></summary>
<br>
**Image Description:**
TrendRadar provides two independent Docker images, deploy according to your needs:
| Image Name | Purpose | Description |
|---------|------|------|
| `wantcat/trendradar` | News Push Service | Scheduled news crawling, push notifications (Required) |
| `wantcat/trendradar-mcp` | AI Analysis Service | MCP protocol support, AI dialogue analysis (Optional) |
> ๐ก **Recommendations**:
> - Only need push functionality: Deploy `wantcat/trendradar` image only
> - Need AI analysis: Deploy both images
---
#### Method 1: Using docker compose (Recommended)
1. **Create Project Directory and Config**:
**Method 1-A: Using git clone (Recommended, Simplest)**
bash # Clone project to local git clone https://github.com/sansan0/TrendRadar.git cd TrendRadar
**Method 1-B: Using wget to download config files**
bash # Create directory structure mkdir -p trendradar/{config,docker} cd trendradar
# Download config file templates wget https://raw.githubusercontent.com/sansan0/TrendRadar/master/config/config.yaml -P config/ wget https://raw.githubusercontent.com/sansan0/TrendRadar/master/config/frequency_words.txt -P config/
# Download docker compose config wget https://raw.githubusercontent.com/sansan0/TrendRadar/master/docker/.env -P docker/ wget https://raw.githubusercontent.com/sansan0/TrendRadar/master/docker/docker-compose.yml -P docker/
> ๐ก **Note**: Key directory structure required for Docker deployment:
current directory/ โโโ config/ โ โโโ config.yaml โ โโโ frequency_words.txt โโโ docker/
โโโ .env
โโโ docker-compose.yml
2. **Config File Description**:
- `config/config.yaml` - Application main config (report mode, push settings, etc.)
- `config/frequency_words.txt` - Keyword config (set your interested trending keywords)
- `.env` - Environment variable config (webhook URLs and scheduled tasks)
**โ๏ธ Environment Variable Override Mechanism (v3.0.5+)**
If you encounter **config.yaml modifications not taking effect** in NAS or other Docker environments, you can directly override configs via environment variables:
| Environment Variable | Corresponding Config | Example Value | Description |
|---------------------|---------------------|---------------|-------------|
| `ENABLE_CRAWLER` | `crawler.enable_crawler` | `true` / `false` | Enable crawler |
| `ENABLE_NOTIFICATION` | `notification.enable_notification` | `true` / `false` | Enable notification |
| `REPORT_MODE` | `report.mode` | `daily` / `incremental` / `current`| Report mode |
| `MAX_ACCOUNTS_PER_CHANNEL` | `notification.max_accounts_per_channel` | `3` | Maximum accounts per channel |
| `PUSH_WINDOW_ENABLED` | `notification.push_window.enabled` | `true` / `false` | Push time window switch |
| `PUSH_WINDOW_START` | `notification.push_window.time_range.start` | `08:00` | Push start time |
| `PUSH_WINDOW_END` | `notification.push_window.time_range.end` | `22:00` | Push end time |
| `ENABLE_WEBSERVER` | - | `true` / `false` | Auto-start web server |
| `WEBSERVER_PORT` | - | `8080` | Web server port (default 8080) |
| `FEISHU_WEBHOOK_URL` | `notification.webhooks.feishu_url` | `https://...` | Feishu Webhook (supports multi-account, use `;` separator) |
**Config Priority**: Environment Variables > config.yaml
**Usage Method**:
- Modify `.env` file, uncomment and fill in needed configs
- Or add directly in NAS/Synology Docker management interface's "Environment Variables"
- Restart container to take effect: `docker compose up -d`
3. **Start Service**:
**Option A: Start All Services (Push + AI Analysis)**
bash # Pull latest images docker compose pull
# Start all services (trend-radar + trend-radar-mcp) docker compose up -d
**Option B: Start News Push Service Only**
bash # Start trend-radar only (scheduled crawling and push) docker compose pull trend-radar docker compose up -d trend-radar
**Option C: Start MCP AI Analysis Service Only**
bash # Start trend-radar-mcp only (AI analysis interface) docker compose pull trend-radar-mcp docker compose up -d trend-radar-mcp
> ๐ก **Tips**:
> - Most users only need to start `trend-radar` for news push functionality
> - Only start `trend-radar-mcp` when using Claude/ChatGPT for AI dialogue analysis
> - Both services are independent and can be flexibly combined
4. **Check Running Status**:
bash # View news push service logs docker logs -f trend-radar
# View MCP AI analysis service logs docker logs -f trend-radar-mcp
# View all container status docker ps | grep trend-radar
# Stop specific service docker compose stop trend-radar # Stop push service docker compose stop trend-radar-mcp # Stop MCP service
#### Method 2: Local Build (Developer Option)
If you need custom code modifications or build your own image:
bash
git clone https://github.com/sansan0/TrendRadar.git cd TrendRadar
vim config/config.yaml vim config/frequency_words.txt
cd docker cp docker-compose-build.yml docker-compose.yml
**Build and Start Services**:
bash
docker compose build docker compose up -d
docker compose build trend-radar docker compose up -d trend-radar
docker compose build trend-radar-mcp docker compose up -d trend-radar-mcp
> ๐ก **Architecture Parameter Notes**:
> - Default builds `amd64` architecture images (suitable for most x86_64 servers)
> - To build `arm64` architecture (Apple Silicon, Raspberry Pi, etc.), set environment variable:
> ```bash
> export DOCKER_ARCH=arm64
> docker compose build
> ```
#### Image Update
bash
docker pull wantcat/trendradar:latest docker pull wantcat/trendradar-mcp:latest docker compose down docker compose up -d
docker compose pull docker compose up -d
**Available Images**:
| Image Name | Purpose | Description |
|---------|------|---------|
| `wantcat/trendradar` | News Push Service | Scheduled news crawling, push notifications |
| `wantcat/trendradar-mcp` | MCP Service | AI analysis features (optional) |
#### Service Management Commands
bash
docker exec -it trend-radar python manage.py status
docker exec -it trend-radar python manage.py run
docker exec -it trend-radar python manage.py logs
docker exec -it trend-radar python manage.py config
docker exec -it trend-radar python manage.py files
docker exec -it trend-radar python manage.py start_webserver # Start web server docker exec -it trend-radar python manage.py stop_webserver # Stop web server docker exec -it trend-radar python manage.py webserver_status # Check web server status
docker exec -it trend-radar python manage.py help
docker restart trend-radar
docker stop trend-radar
docker rm trend-radar
> ๐ก **Web Server Notes**:
> - After starting, access latest report at `http://localhost:8080`
> - Access historical reports via directory navigation (e.g., `http://localhost:8080/2025-xx-xx/`)
> - Port can be configured in `.env` file with `WEBSERVER_PORT` parameter
> - Auto-start: Set `ENABLE_WEBSERVER=true` in `.env`
> - Security: Static files only, limited to output directory, localhost binding only
#### Data Persistence
Generated reports and data are saved in `./output` directory by default. Data persists even if container is restarted or removed.
**๐ Web Report Access Paths**:
TrendRadar generates daily summary HTML reports to two locations simultaneously:
| File Location | Access Method | Use Case |
|--------------|---------------|----------|
| `output/index.html` | Direct host access | **Docker Deployment** (via Volume mount, visible on host) |
| `index.html` | Root directory access | **GitHub Pages** (repository root, auto-detected by Pages) |
| `output/YYYY-MM-DD/html/ๅฝๆฅๆฑๆป.html` | Historical reports | All environments (archived by date) |
**Local Access Examples**:
bash
docker exec -it trend-radar python manage.py start_webserver
http://localhost:8080 # Access latest report (default index.html) http://localhost:8080/2025-xx-xx/ # Access reports for specific date http://localhost:8080/2025-xx-xx/html/ # Browse all HTML files for that date
open ./output/index.html # macOS start ./output/index.html # Windows xdg-open ./output/index.html # Linux
open ./output/2025-xx-xx/html/ๅฝๆฅๆฑๆป.html
**Why two index.html files?**
- `output/index.html`: Docker Volume mounted to host, can be opened locally
- `index.html`: Pushed to repository by GitHub Actions, auto-deployed by GitHub Pages
> ๐ก **Tip**: Both files have identical content, choose either one to access.
#### Troubleshooting
bash
docker inspect trend-radar
docker logs --tail 100 trend-radar
docker exec -it trend-radar /bin/bash
docker exec -it trend-radar ls -la /app/config/
#### MCP Service Deployment (AI Analysis Feature)
If you need to use AI analysis features, you can deploy the standalone MCP service container.
**Architecture Description**:
mermaid flowchart TB
subgraph trend-radar["trend-radar"]
A1[Scheduled News Fetching]
A2[Push Notifications]
end
subgraph trend-radar-mcp["trend-radar-mcp"]
B1[127.0.0.1:3333]
B2[AI Analysis API]
end
subgraph shared["Shared Volume"]
C1["config/ (ro)"]
C2["output/ (ro)"]
end
trend-radar --> shared
trend-radar-mcp --> shared
**Quick Start**:
Use docker compose to start both news push and MCP services:
bash
git clone https://github.com/sansan0/TrendRadar.git cd TrendRadar/docker docker compose up -d
mkdir trendradar && cd trendradar wget https://raw.githubusercontent.com/sansan0/TrendRadar/master/docker/docker-compose.yml wget https://raw.githubusercontent.com/sansan0/TrendRadar/master/docker/.env mkdir -p config output
wget https://raw.githubusercontent.com/sansan0/TrendRadar/master/config/config.yaml -P config/ wget https://raw.githubusercontent.com/sansan0/TrendRadar/master/config/frequency_words.txt -P config/
docker compose up -d
docker ps | grep trend-radar
**Start MCP Service Separately**:
bash
docker run -d --name trend-radar-mcp \ -p 127.0.0.1:3333:3333 \ -v $(pwd)/config:/app/config:ro \ -v $(pwd)/output:/app/output:ro \ -e TZ=Asia/Shanghai \ wantcat/trendradar-mcp:latest
docker run -d --name trend-radar-mcp
-p 127.0.0.1:3333:3333
-v ${PWD}/config:/app/config:ro
-v ${PWD}/output:/app/output:ro
-e TZ=Asia/Shanghai `
wantcat/trendradar-mcp:latest
> โ ๏ธ **Note**: Ensure `config/` and `output/` folders exist in current directory with config files and news data before running.
**Verify Service**:
bash
curl http://127.0.0.1:3333/mcp
docker logs -f trend-radar-mcp
**Configure in AI Clients**:
After MCP service starts, configure based on your client:
**Cherry Studio** (Recommended, GUI config):
- Settings โ MCP Server โ Add
- Type: `streamableHttp`
- URL: `http://127.0.0.1:3333/mcp`
**Claude Desktop / Cline** (JSON config):
json { "mcpServers": {
"trendradar": {
"url": "http://127.0.0.1:3333/mcp",
"type": "streamableHttp"
}
} }
> ๐ก **Tip**: MCP service only listens on local port (127.0.0.1) for security. For remote access, configure reverse proxy and authentication yourself.
</details>
### 7. Report Configuration
<details>
<summary>๐ Click to expand: <strong>Report-Related Parameter Configuration</strong></summary>
<br>
**Configuration Location:** `report` section in `config/config.yaml`
yaml report: mode: "daily" # Push mode rank_threshold: 5 # Ranking highlight threshold sort_by_position_first: false # Sorting priority max_news_per_keyword: 0 # Maximum display count per keyword reverse_content_order: false # Content order configuration
#### Configuration Details
| Config Item | Type | Default | Description |
|------------|------|---------|-------------|
| `mode` | string | `daily` | Push mode, options: `daily`/`incremental`/`current`, see [Push Mode Details](#3-push-mode-details) |
| `rank_threshold` | int | `5` | Ranking highlight threshold, news with rank โค this value will be displayed in bold |
| `sort_by_position_first` | bool | `false` | Sorting priority: `false`=sort by news count, `true`=sort by config position |
| `max_news_per_keyword` | int | `0` | Maximum display count per keyword, `0`=unlimited |
| `reverse_content_order` | bool | `false` | Content order: `false`=trending keywords stats first, `true`=new trending news first |
#### Content Order Configuration (v3.5.0 New)
Controls display order of two content sections in push messages and HTML reports:
| Config Value | Display Order |
|-------------|--------------|
| `false` (default) | โ Trending Keywords Stats โ โก New Trending News |
| `true` | โ New Trending News โ โก Trending Keywords Stats |
**Use Cases:**
- `false` (default): Suitable for users focusing on keyword match results, view categorized stats first
- `true`: Suitable for users focusing on latest updates, prioritize viewing new trending topics
**Docker Environment Variable:**
bash REVERSE_CONTENT_ORDER=true
#### Sorting Priority Configuration
**Example Scenario:** Config order A, B, C, news count A(3), B(10), C(5)
| Config Value | Display Order | Use Case |
|-------------|--------------|----------|
| `false` (default) | B(10) โ C(5) โ A(3) | Focus on popularity trends |
| `true` | A(3) โ B(10) โ C(5) | Focus on personal priority |
**Docker Environment Variables:**
bash SORT_BY_POSITION_FIRST=true MAX_NEWS_PER_KEYWORD=10
</details>
### 8. Push Window Configuration
<details>
<summary>๐ Click to expand: <strong>Push Time Window Control Details</strong></summary>
<br>
**Configuration Location:** `notification.push_window` section in `config/config.yaml`
yaml notification: push_window:
enabled: false # Whether to enable
time_range:
start: "20:00" # Start time (Beijing time)
end: "22:00" # End time (Beijing time)
once_per_day: true # Push only once per day
#### Configuration Details
| Config Item | Type | Default | Description |
|------------|------|---------|-------------|
| `enabled` | bool | `false` | Whether to enable push time window control |
| `time_range.start` | string | `"20:00"` | Push window start time (Beijing time, HH:MM format) |
| `time_range.end` | string | `"22:00"` | Push window end time (Beijing time, HH:MM format) |
| `once_per_day` | bool | `true` | `true`=push only once per day within window, `false`=push every execution within window |
#### Use Cases
| Scenario | Configuration Example |
|----------|---------------------|
| **Working Hours Push** | `start: "09:00"`, `end: "18:00"`, `once_per_day: false` |
| **Evening Summary Push** | `start: "20:00"`, `end: "22:00"`, `once_per_day: true` |
| **Lunch Break Push** | `start: "12:00"`, `end: "13:00"`, `once_per_day: true` |
#### Important Notice
> โ ๏ธ **GitHub Actions Users Note:**
> - GitHub Actions execution time is unstable, may have ยฑ15 minutes deviation
> - Time range should be at least **2 hours** wide
> - For precise timed push, recommend **Docker deployment** on personal server
#### Docker Environment Variables
bash PUSH_WINDOW_ENABLED=true PUSH_WINDOW_START=09:00 PUSH_WINDOW_END=18:00 PUSH_WINDOW_ONCE_PER_DAY=false
#### Complete Configuration Examples
**Scenario: Push once between 8-10 PM daily**
yaml notification: push_window:
enabled: true
time_range:
start: "20:00"
end: "22:00"
once_per_day: true
**Scenario: Push every hour during working hours**
yaml notification: push_window:
enabled: true
time_range:
start: "09:00"
end: "18:00"
once_per_day: false
</details>
### 9. Execution Frequency Configuration
<details>
<summary>๐ Click to expand: <strong>Automatic Execution Frequency Settings</strong></summary>
<br>
**Configuration Location:** `schedule` section in `.github/workflows/crawler.yml`
yaml on: schedule:
- cron: "0 * * * *" # Run every hour
#### What is a Cron Expression?
Cron is a time-based job scheduler format, consisting of 5 parts: `minute hour day month weekday`
โโโโโโโโโโโโโโ minute (0-59) โ โโโโโโโโโโโโโโ hour (0-23) โ โ โโโโโโโโโโโโโโ day (1-31) โ โ โ โโโโโโโโโโโโโโ month (1-12) โ โ โ โ โโโโโโโโโโโโโโ weekday (0-6, 0=Sunday) โ โ โ โ โ
#### Common Configuration Examples
| Desired Effect | Cron Expression | Description |
|---------------|----------------|-------------|
| Every hour | `0 * * * *` | Run at minute 0 of every hour (default) |
| Every 30 minutes | `*/30 * * * *` | Run every 30 minutes |
| Daily at 8 AM | `0 0 * * *` | UTC 0:00 = Beijing 8:00 AM |
| Working hours | `*/30 0-14 * * *` | Beijing 8:00-22:00, every 30 minutes |
| 3 times daily | `0 0,6,12 * * *` | Beijing 8:00, 14:00, 20:00 |
#### Important Notes
> โ ๏ธ **Time Zone Note**: GitHub Actions uses **UTC time**, Beijing time needs to **subtract 8 hours**
> - Want Beijing 8:00 AM run โ Set UTC 0:00
> - Want Beijing 8:00 PM run โ Set UTC 12:00
> โ ๏ธ **Frequency Limit**: GitHub has a limit on Actions execution count per account
> - **Recommendation**: Don't set intervals shorter than 30 minutes
> - **Reason**: Too frequent may be considered abuse, facing account ban risk
> - **Reality**: GitHub Actions execution time has inherent deviation, setting too precise is meaningless
#### Modification Method
1. Open your forked repository
2. Find `.github/workflows/crawler.yml` file
3. Click edit (pencil icon)
4. Modify the expression in `cron: "0 * * * *"`
5. Click "Commit changes" to save
</details>
### 10. Multiple Account Push Configuration
<details>
<summary>๐ Click to expand: <strong>Multiple Account Push Configuration Guide</strong></summary>
<br>
**Configuration Location:** `notification` section in `config/config.yaml`
> ### โ ๏ธ **Security Warning**
> **GitHub Fork Users: DO NOT configure push information in `config.yaml`!**
>
> - **Risk**: `config.yaml` will be committed to public Git repositories. Configuring push information (Webhook URLs, Tokens, etc.) will expose sensitive data
> - **Recommended Methods**:
> - **GitHub Actions Users** โ Use GitHub Secrets environment variables
> - **Docker Users** โ Use [`.env` file configuration](#6-docker-deployment) (`.env` is in `.gitignore` and won't be committed)
> - **Local Development Users**: Can configure in `config.yaml` (ensure it won't be pushed to public repositories)
#### Supported Channels
| Channel | Configuration Item | Pairing Required | Description |
|---------|-------------------|-----------------|-------------|
| **Feishu** | `feishu_url` | No | Multiple webhook URLs |
| **DingTalk** | `dingtalk_url` | No | Multiple webhook URLs |
| **WeWork** | `wework_url` | No | Multiple webhook URLs |
| **Telegram** | `telegram_bot_token` + `telegram_chat_id` | โ
Yes | Token and chat_id quantities must match |
| **ntfy** | `ntfy_topic` + `ntfy_token` | โ
Yes | Topic and token quantities must match (token optional) |
| **Bark** | `bark_url` | No | Multiple push URLs |
| **Slack** | `slack_webhook_url` | No | Multiple webhook URLs |
| **Email** | `email_to` | - | Already supports multiple recipients (comma-separated), no modification needed |
#### Recommended Method 1: GitHub Actions Environment Variables
**Configuration Location**: GitHub Repo โ Settings โ Secrets and variables โ Actions โ Repository secrets
**Basic Configuration Example**:
bash
MAX_ACCOUNTS_PER_CHANNEL=3
FEISHU_WEBHOOK_URL=https://hook1.feishu.cn/xxx;https://hook2.feishu.cn/yyy;https://hook3.feishu.cn/zzz
DINGTALK_WEBHOOK_URL=https://oapi.dingtalk.com/xxx;https://oapi.dingtalk.com/yyy
WEWORK_WEBHOOK_URL=https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxx;https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=yyy
BARK_URL=https://api.day.app/key1;https://api.day.app/key2
SLACK_WEBHOOK_URL=https://hooks.slack.com/xxx;https://hooks.slack.com/yyy
**Paired Configuration Examples (Telegram and ntfy)**:
<details>
<summary><strong>Telegram Paired Configuration</strong></summary>
bash
TELEGRAM_BOT_TOKEN=123456:AAA-BBB;789012:CCC-DDD TELEGRAM_CHAT_ID=-100111;-100222
TELEGRAM_BOT_TOKEN=token1;token2;token3 TELEGRAM_CHAT_ID=id1;id2
**Note**: The quantities of `token` and `chat_id` must match exactly, otherwise the channel push will be skipped.
</details>
<details>
<summary><strong>ntfy Paired Configuration</strong></summary>
bash
NTFY_TOPIC=topic1;topic2;topic3 NTFY_TOKEN=;token_for_topic2;
NTFY_TOPIC=topic1;topic2 NTFY_TOKEN=token1;token2
NTFY_TOPIC=topic1;topic2 NTFY_TOKEN=token1;token2;token3
**Notes**:
- If a topic doesn't need a token, leave it empty at the corresponding position (between two semicolons)
- The quantities of `topic` and `token` must match
</details>
---
#### Recommended Method 2: Docker Environment Variables (.env)
**Configuration Location**: `docker/.env` file in project root directory
**Basic Configuration Example**:
bash
MAX_ACCOUNTS_PER_CHANNEL=3
FEISHU_WEBHOOK_URL=https://hook1.feishu.cn/xxx;https://hook2.feishu.cn/yyy;https://hook3.feishu.cn/zzz
DINGTALK_WEBHOOK_URL=https://oapi.dingtalk.com/xxx;https://oapi.dingtalk.com/yyy
WEWORK_WEBHOOK_URL=https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxx;https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=yyy
BARK_URL=https://api.day.app/key1;https://api.day.app/key2
SLACK_WEBHOOK_URL=https://hooks.slack.com/xxx;https://hooks.slack.com/yyy
**Paired Configuration Examples (Telegram and ntfy)**:
<details>
<summary><strong>Telegram Paired Configuration</strong></summary>
bash
TELEGRAM_BOT_TOKEN=123456:AAA-BBB;789012:CCC-DDD TELEGRAM_CHAT_ID=-100111;-100222
TELEGRAM_BOT_TOKEN=token1;token2;token3 TELEGRAM_CHAT_ID=id1;id2
**Note**: The quantities of `token` and `chat_id` must match exactly, otherwise the channel push will be skipped.
</details>
<details>
<summary><strong>ntfy Paired Configuration</strong></summary>
bash
NTFY_TOPIC=topic1;topic2;topic3 NTFY_TOKEN=;token_for_topic2;
NTFY_TOPIC=topic1;topic2 NTFY_TOKEN=token1;token2
NTFY_TOPIC=topic1;topic2 NTFY_TOKEN=token1;token2;token3
**Notes**:
- If a topic doesn't need a token, leave it empty at the corresponding position (between two semicolons)
- The quantities of `topic` and `token` must match
</details>
---
#### Push Behavior Description
1. **Independent Push**: Each account sends independently, one failure doesn't affect other accounts
2. **Partial Success**: As long as one account sends successfully, the overall result is considered successful
3. **Log Differentiation**: Multi-account logs show "Account 1", "Account 2", etc.
4. **Batch Interval**: Multi-account increases total send time (each account independently calculates batch interval)
---
#### FAQ
<details>
<summary><strong>Q1: What happens if more than 3 accounts are configured?</strong></summary>
<br>
The system will automatically truncate to the configured maximum quantity and output warning logs. You can adjust the limit via `max_accounts_per_channel`.
**โ ๏ธ Special Note for GitHub Actions Users**:
- **Not recommended to configure too many accounts** (suggest no more than 3), which may cause:
- **Trigger GitHub Actions rate limits**: Frequent network requests may be identified as abnormal behavior
- **Affect Workflow execution time**: Multi-account pushing will extend runtime and may exceed free quotas
- **Potential account risks**: Excessive use of GitHub Actions resources may affect account status
- **Recommended Practices**:
- Use `max_accounts_per_channel: 3` or lower values
- Adjust Cron execution frequency (e.g., change from hourly to every 2-3 hours)
- Prioritize the most important push channels and avoid configuring too many accounts
</details>
<details>
<summary><strong>Q2: Will multi-accounts affect push speed?</strong></summary>
<br>
Yes. Each account sends independently, total time = number of accounts ร single account send time. Recommend controlling the number of accounts.
</details>
<details>
<summary><strong>Q3: How can local development users configure in config.yaml?</strong></summary>
<br>
If you are doing local development and **will not push code to public repositories**, you can configure directly in `config/config.yaml`:
yaml notification: enable_notification: true max_accounts_per_channel: 3
webhooks:
feishu_url: "https://hook1.feishu.cn/xxx;https://hook2.feishu.cn/yyy"
telegram_bot_token: "token1;token2"
telegram_chat_id: "id1;id2"
**โ ๏ธ Important Reminder**:
- Ensure `config/config.yaml` is in `.gitignore` (if you will commit code)
- Or only use in local development environment, **never commit to public repositories**
</details>
</details>
<br>
### 11. Storage Configuration (v4.0.0 New)
<details>
<summary>๐ Click to expand: <strong>Storage Configuration Guide</strong></summary>
<br>
#### Storage Backend Selection
TrendRadar v4.0.0 introduces **multi-backend storage architecture**, supporting automatic backend selection or manual specification:
| Configuration Value | Description | Applicable Scenarios |
|---------------------|-------------|---------------------|
| `auto` (default) | Auto-select backend: GitHub ActionsโR2, other environmentsโLocal | Most users (recommended) |
| `local` | Force use of local SQLite | Docker/local deployment |
| `r2` | Force use of Cloudflare R2 | Cloud storage required |
**Configuration Location**:
- GitHub Actions: Set `STORAGE_BACKEND` environment variable in GitHub Secrets
- Docker: Configure `STORAGE_BACKEND=local` in `.env` file
- Local: Add `STORAGE_BACKEND` in environment variables or use auto mode
---
#### Database Structure Optimization (v4.0.0)
v4.0.0 made significant optimizations to database structure, removing redundant fields and improving data normalization:
##### 1. Removed Redundant Fields
Removed the following redundant fields from `news` table:
| Field Name | Removal Reason | Alternative |
|------------|----------------|------------|
| `source_name` | Duplicate with platform name | Get via `platforms` table JOIN query |
| `crawl_date` | Duplicate with file path date | Infer from file path timestamp |
**Migration Notes**: Old databases are incompatible, see [Breaking Changes](#breaking-changes-v400) section
##### 2. New Platforms Table
Added `platforms` table for unified management of platform information:
sql CREATE TABLE IF NOT EXISTS platforms (
id TEXT PRIMARY KEY, -- Platform ID (immutable, e.g., 'zhihu', 'weibo')
name TEXT NOT NULL, -- Platform display name (mutable, e.g., 'Zhihu', 'Weibo')
enabled INTEGER DEFAULT 1 -- Whether enabled (1=enabled, 0=disabled)
);
**Design Advantages**:
- `id` field is immutable, maintains data consistency
- `name` field is mutable, supports internationalization and customization
- Historical data remains valid when modifying platform names
##### 3. Crawl Source Status Normalization
Replaced original comma-separated string storage `successful_sources` field with normalized `crawl_source_status` table:
sql CREATE TABLE IF NOT EXISTS crawl_source_status (
id INTEGER PRIMARY KEY AUTOINCREMENT,
file_path TEXT NOT NULL, -- File path (e.g., 'output/2025-12-09/news.db')
platform_id TEXT NOT NULL, -- Platform ID (foreign key to platforms.id)
success INTEGER NOT NULL, -- Whether crawl succeeded (1=success, 0=failed)
crawl_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (platform_id) REFERENCES platforms(id)
);
**Design Advantages**:
- Supports efficient SQL queries (e.g., calculate success rate by platform)
- Easy statistics and analysis (no string splitting required)
- Normalized structure, avoids data redundancy
##### 4. File Path Format Standardization
**Old Format**: `output/2025ๅนด12ๆ09ๆฅ/news_14-30.txt`
**New Format**: `output/2025-12-09/news.db`
**Changes**:
- Date format: Chinese format โ ISO 8601 standard format
- Filename: Multiple time-stamped TXT files โ single SQLite database file
- Extension: `.txt` โ `.db`
**Advantages**:
- Cross-platform compatibility (avoids Chinese path issues)
- Easier programmatic parsing
- International standard, better maintainability
---
#### Remote Cloud Storage Configuration
When using remote cloud storage (required for GitHub Actions environment), configure the following environment variables:
| Environment Variable | Description | Required | Example Value |
|----------------------|-------------|----------|--------------|
| `S3_BUCKET_NAME` | Bucket name | โ
Yes | `trendradar-data` |
| `S3_ACCESS_KEY_ID` | Access key ID | โ
Yes | `abc123...` |
| `S3_SECRET_ACCESS_KEY` | Access key | โ
Yes | `xyz789...` |
| `S3_ENDPOINT_URL` | S3 API endpoint | โ
Yes | `https://<account-id>.r2.cloudflarestorage.com` |
| `S3_REGION` | Region (optional) | โ No | `auto` |
**Configuration Method**:
- GitHub Actions: Configure in GitHub Secrets (see [Quick Start - Remote Storage Configuration](#2-setup-github-secrets-required--optional-platforms))
- Docker/Local: Configure in `.env` file (remote storage is optional)
---
#### Data Cleanup Strategy
v4.0.0 added automatic data cleanup feature, supporting scheduled cleanup of old data:
**Configuration Items**: `LOCAL_RETENTION_DAYS` and `REMOTE_RETENTION_DAYS`
| Configuration Value | Description |
|---------------------|-------------|
| `0` (default) | Disable cleanup, keep all data |
| Positive integer (e.g., `30`) | Only keep recent N days of data, auto-delete old data |
**Configuration Method**:
bash
LOCAL_RETENTION_DAYS=30 REMOTE_RETENTION_DAYS=30
LOCAL_RETENTION_DAYS=30 REMOTE_RETENTION_DAYS=30
export LOCAL_RETENTION_DAYS=30
**Cleanup Rules**:
- Cleanup executes during each crawl task
- Local: Deletes `output/YYYY-MM-DD/` directories older than N days
- Remote: Deletes cloud objects older than N days (e.g., `news/2025-11-10.db`)
---
#### Timezone Configuration
v4.0.0 added timezone configuration support, using IANA standard time zone names:
**Configuration Item**: `TIMEZONE`
| Configuration Value | Description | Example |
|---------------------|-------------|---------|
| Not set (default) | Use UTC+0 | - |
| IANA time zone name | Specify time zone | `Asia/Shanghai`, `America/New_York`, `Europe/London` |
**Configuration Method**:
bash
TIMEZONE=Asia/Shanghai
TIMEZONE=Asia/Shanghai
export TIMEZONE=Asia/Shanghai
**Common IANA Time Zones**:
- China: `Asia/Shanghai`
- United States East: `America/New_York`
- United States West: `America/Los_Angeles`
- United Kingdom: `Europe/London`
- Japan: `Asia/Tokyo`
---
#### Breaking Changes (v4.0.0)
**โ ๏ธ Important Notice**: v4.0.0 made breaking changes to database structure, **old databases are incompatible**
**Impact**:
- Cannot directly read v3.x version data
- Need to re-crawl data to build new database
- **No automatic migration tool provided**
**Recommendations**:
1. **Fresh Start**: Recommended to start from scratch to accumulate data
2. **Keep Historical Data**: If need to preserve v3.x historical data, can rename old `output/` directory (e.g., `output_v3_backup/`) before running new version
**Data Format Comparison**:
| Item | v3.x | v4.0.0 |
|------|------|--------|
| File path format | `output/2025ๅนด12ๆ09ๆฅ/` | `output/2025-12-09/` |
| Data file | Multiple `news_HH-MM.txt` files | Single `news.db` file |
| Database fields | Contains `source_name`, `crawl_date` | Removed redundant fields |
| Platform management | No independent table | Added `platforms` table |
| Crawl status | Comma-separated string | Normalized `crawl_source_status` table |
</details>
<br>
## ๐ค AI Analysis
TrendRadar v3.0.0 added **MCP (Model Context Protocol)** based AI analysis feature, allowing natural language conversations with news data for deep analysis.
### โ ๏ธ Important Notice Before Use
**Critical: AI features require local news data support**
AI analysis **does not** query real-time online data directly, but analyzes **locally accumulated news data** (stored in the `output` folder)
#### Usage Instructions:
1. **Built-in Test Data**: The `output` directory includes news data from **November 1-15, 2025** by default for quick feature testing
2. **Query Limitations**:
- โ
Only query data within available date range (Nov 1-15)
- โ Cannot query real-time news or future dates
3. **Getting Latest Data**:
- Test data is for quick experience only, **recommend deploying the project yourself** to get real-time data
- Follow [Quick Start](#-quick-start) to deploy and run the project
- After accumulating news data for at least 1 day, you can query the latest trending topics
---
### 1. Quick Deployment
Cherry Studio provides GUI config interface, 5-minute quick deployment, complex parts are one-click install.
**Illustrated Deployment Tutorial**: Now updated to my WeChat Official Account (see [FAQ & Support](#-faq--support)), reply "mcp" to get
**Detailed Deployment Tutorial**: [README-Cherry-Studio.md](README-Cherry-Studio.md)
**Deployment Mode Description**:
- **STDIO Mode (Recommended)**: One-time configuration, no need to reconfigure later. The **illustrated deployment tutorial** only demonstrates this mode's configuration.
- **HTTP Mode (Alternative)**: If STDIO mode configuration encounters issues, you can use HTTP mode. This mode's configuration is basically the same as STDIO, but only requires copy-pasting one line, less error-prone. The only thing to note is that you need to manually start the service before each use. For details, refer to the HTTP mode section at the bottom of [README-Cherry-Studio.md](README-Cherry-Studio.md).
### 2. Learning to Talk with AI
**Detailed Conversation Tutorial**: [README-MCP-FAQ.md](README-MCP-FAQ.md)
**Question Effect**:
<details>
<summary>๐ Click to expand: <strong>View AI Conversation Example</strong></summary>
<br>
> ๐ก **Tip**: Actually not recommended to ask multiple questions at once. If your chosen AI model cannot even sequentially call as shown below, suggest switching models.
<img src="/_image/ai2.png" alt="MCP usage effect" width="600">
</details>
<br>
## ๐ MCP Clients
TrendRadar MCP service supports standard Model Context Protocol (MCP), can connect to various AI clients supporting MCP for smart analysis.
### Supported Clients
**Note**:
- Replace `/path/to/TrendRadar` with your actual project path
- Windows paths use double backslashes: `C:\\Users\\YourName\\TrendRadar`
- Remember to restart after saving
<details>
<summary><b>๐ Click to expand: Claude Desktop</b></summary>
#### Config File Method
Edit Claude Desktop's MCP config file:
**Windows**:
`%APPDATA%\Claude\claude_desktop_config.json`
**Mac**:
`~/Library/Application Support/Claude/claude_desktop_config.json`
**Config Content**:
json { "mcpServers": {
"trendradar": {
"command": "uv",
"args": [
"--directory",
"/path/to/TrendRadar",
"run",
"python",
"-m",
"mcp_server.server"
],
"env": {},
"disabled": false,
"alwaysAllow": []
}
} }
</details>
<details>
<summary><b>๐ Click to expand: Cursor</b></summary>
#### Method 1: HTTP Mode
1. **Start HTTP Service**:
bash # Windows start-http.bat
# Mac/Linux ./start-http.sh
2. **Configure Cursor**:
**Project Level Config** (Recommended):
Create `.cursor/mcp.json` in project root:
json {
"mcpServers": {
"trendradar": {
"url": "http://localhost:3333/mcp",
"description": "TrendRadar News Trending Aggregation Analysis"
}
}
}
**Global Config**:
Create `~/.cursor/mcp.json` in user directory (same content)
3. **Usage Steps**:
- Restart Cursor after saving config
- Check connected tools in chat interface "Available Tools"
- Start using: `Search today's "AI" related news`
#### Method 2: STDIO Mode (Recommended)
Create `.cursor/mcp.json`:
json { "mcpServers": {
"trendradar": {
"command": "uv",
"args": [
"--directory",
"/path/to/TrendRadar",
"run",
"python",
"-m",
"mcp_server.server"
]
}
} }
</details>
<details>
<summary><b>๐ Click to expand: VSCode (Cline/Continue)</b></summary>
#### Cline Configuration
Add in Cline's MCP settings:
**HTTP Mode**:
json { "trendradar": {
"url": "http://localhost:3333/mcp",
"type": "streamableHttp",
"autoApprove": [],
"disabled": false
} }
**STDIO Mode** (Recommended):
json { "trendradar": {
"command": "uv",
"args": [
"--directory",
"/path/to/TrendRadar",
"run",
"python",
"-m",
"mcp_server.server"
],
"type": "stdio",
"disabled": false
} }
#### Continue Configuration
Edit `~/.continue/config.json`:
json { "experimental": {
"modelContextProtocolServers": [
{
"transport": {
"type": "stdio",
"command": "uv",
"args": [
"--directory",
"/path/to/TrendRadar",
"run",
"python",
"-m",
"mcp_server.server"
]
}
}
]
} }
**Usage Examples**:
Analyze recent 7 days "Tesla" popularity trend Generate today's trending summary report Search "Bitcoin" related news and analyze sentiment
</details>
<details>
<summary><b>๐ Click to expand: Claude Code CLI</b></summary>
#### HTTP Mode Configuration
bash
claude mcp add --transport http trendradar http://localhost:3333/mcp
claude mcp list
#### Usage Examples
bash
claude "Search today's Zhihu trending news, top 10"
claude "Analyze 'artificial intelligence' topic popularity trend for the past week"
claude "Compare Zhihu and Weibo platform attention on 'Bitcoin'"
</details>
<details>
<summary><b>๐ Click to expand: MCP Inspector</b> (Debug Tool)</summary>
<br>
MCP Inspector is the official debug tool for testing MCP connections:
#### Usage Steps
1. **Start TrendRadar HTTP Service**:
bash # Windows start-http.bat
# Mac/Linux ./start-http.sh
2. **Start MCP Inspector**:
bash npx @modelcontextprotocol/inspector
3. **Connect in Browser**:
- Visit: `http://localhost:3333/mcp`
- Test "Ping Server" function to verify connection
- Check "List Tools" returns 14 tools:
- Date Parsing: resolve_date_range
- Basic Query: get_latest_news, get_news_by_date, get_trending_topics
- Smart Search: search_news, search_related_news_history
- Advanced Analysis: analyze_topic_trend, analyze_data_insights, analyze_sentiment, find_similar_news, generate_summary_report
- System Management: get_current_config, get_system_status, trigger_crawl
</details>
<details>
<summary><b>๐ Click to expand: Other MCP-Compatible Clients</b></summary>
<br>
Any client supporting Model Context Protocol can connect to TrendRadar:
#### HTTP Mode
**Service Address**: `http://localhost:3333/mcp`
**Basic Config Template**:
json { "name": "trendradar", "url": "http://localhost:3333/mcp", "type": "http", "description": "News Trending Aggregation Analysis" }
#### STDIO Mode (Recommended)
**Basic Config Template**:
json { "name": "trendradar", "command": "uv", "args": [
"--directory",
"/path/to/TrendRadar",
"run",
"python",
"-m",
"mcp_server.server"
], "type": "stdio" }
**Notes**:
- Replace `/path/to/TrendRadar` with actual project path
- Windows paths use backslash escape: `C:\\Users\\...`
- Ensure project dependencies installed (ran setup script)
</details>
<br>
## โ FAQ & Support
> If you want to support this project, you can search **Tencent Charity** on WeChat and donate to **Education Support Programs** as you wish
>
> Thanks to those who participated in the **one-yuan donation**! You are listed in the **Acknowledgments** at the top. Your support gives more motivation to open source maintenance. Personal donation QR code has been removed.
- **GitHub Issues**: Suitable for targeted answers. Please provide complete info when asking (screenshots, error logs, system environment, etc.)
- **WeChat Official Account**: Suitable for quick consultation. Suggest priority to communicate in public comment area of related articles. If private message, please use polite language ๐
- ๐ก Deployment successful? Come to our official account to share your experience! Your likes and suggestions are the driving force for continuous updates~
<div align="center">
| WeChat Official Account |
|:---:|
| <img src="_image/weixin.png" width="400" title="Silicon Tea Room"/> |
</div>
<br>
---
## ๐ช Sponsors
> Tracking so many trending topics daily, writing reports, replying messages making your wrists tired?
>
> TryใFlashSpeakใAI Voice Input - Speak instead of type, 4x faster โก
>
> On-device Model โข Lightning Fast โข Absolute Privacy โข Mac/Win Support
>
> From reading trends to content output, double your efficiency ๐
<div align="center">
[](https://shandianshuo.cn) [](https://shandianshuo.cn)
<a href="https://shandianshuo.cn" target="_blank">
<img src="_image/banner-shandianshuo.png" alt="FlashSpeak" width="700"/>
</a>
</div>
---
### Common Questions
<details>
<summary><b>๐ Click to expand: Q1: HTTP Service Cannot Start?</b></summary>
<br>
**Check Steps**:
1. Confirm port 3333 is not occupied:
bash # Windows netstat -ano | findstr :3333
# Mac/Linux lsof -i :3333
2. Check if project dependencies installed:
bash # Re-run install script # Windows: setup-windows.bat or setup-windows-en.bat # Mac/Linux: ./setup-mac.sh
3. View detailed error logs:
bash uv run python -m mcp_server.server --transport http --port 3333
4. Try custom port:
bash uv run python -m mcp_server.server --transport http --port 33333
</details>
<details>
<summary><b>๐ Click to expand: Q2: Client Cannot Connect to MCP Service?</b></summary>
<br>
**Solutions**:
1. **STDIO Mode**:
- Confirm UV path correct (run `which uv` or `where uv`)
- Confirm project path correct and no Chinese characters
- Check client error logs
2. **HTTP Mode**:
- Confirm service started (visit `http://localhost:3333/mcp`)
- Check firewall settings
- Try using 127.0.0.1 instead of localhost
3. **General Checks**:
- Restart client application
- Check MCP service logs
- Use MCP Inspector to test connection
</details>
<details>
<summary><b>๐ Click to expand: Q3: Tool Call Failed or Returns Error?</b></summary>
<br>
**Possible Reasons**:
1. **Data Does Not Exist**:
- Confirm crawler has run (have output directory data)
- Check query date range has data
- Check available dates in output directory
2. **Parameter Error**:
- Check date format: `YYYY-MM-DD`
- Confirm correct platform ID: `zhihu`, `weibo`, etc.
- See parameter descriptions in tool docs
3. **Config Issues**:
- Confirm `config/config.yaml` exists
- Confirm `config/frequency_words.txt` exists
- Check config file format is correct
</details>
<br>
## ๐ Related Projects
> **4 Related Articles** (Chinese):
- [Comment here for mobile Q&A by project author](https://mp.weixin.qq.com/s/KYEPfTPVzZNWFclZh4am_g)
- [Breaking 1000 stars in 2 months - My GitHub project promotion experience](https://mp.weixin.qq.com/s/jzn0vLiQFX408opcfpPPxQ)
- [Important notes for running this project via GitHub fork](https://mp.weixin.qq.com/s/C8evK-U7onG1sTTdwdW2zg)
- [How to write WeChat Official Account or news articles based on this project](https://mp.weixin.qq.com/s/8ghyfDAtQZjLrnWTQabYOQ)
> **AI Development**:
- If you have niche requirements, you can develop based on my project yourself, even with zero programming experience
- All my open-source projects use my own **AI-assisted software** to improve development efficiency, this tool is now open-source
- **Core Function**: Quickly filter project code to feed AI, you just need to add personal requirements
- **Project Address**: https://github.com/sansan0/ai-code-context-helper
### Other Projects
> ๐ Chairman Mao's Footprint Map - Interactive dynamic display of complete trajectory 1893-1976. Welcome comrades to contribute data
- https://github.com/sansan0/mao-map
> Bilibili Comment Data Visualization Analysis Software
- https://github.com/sansan0/bilibili-comment-analyzer
### Project Workflow Diagram
mermaid flowchart TD
A[๐ค User Start] --> B{๐ Choose Deployment}
B -->|Cloud Deployment| C1[๐ด Fork to GitHub]
B -->|Local Deployment| C2[๐ณ Docker Deploy]
C1 --> D[โ๏ธ Configure Notification<br/>Multiple channels supported]
C2 --> D
D --> E[Choose method:<br/>๐ฑWeWork ๐ฌFeishu ๐DingTalk<br/>๐Telegram ๐งEmail]
E --> F[๐ Fill notification params<br/>GitHub Secrets or Env Vars]
F --> G[๐ Configure keywords<br/>config/frequency_words.txt<br/>Normal/Required+/Filter!]
G --> H[๐ฏ Choose mode<br/>config/config.yaml]
H --> H1[๐ daily - Daily summary<br/>Scheduled push all matches]
H --> H2[๐ฐ current - Current rankings<br/>Scheduled push latest]
H --> H3[๐ incremental - Incremental<br/>Push only new content]
H1 --> I[Optional: Push time window<br/>โฐ Limit push time range]
H2 --> I
H3 --> I
I --> J[โ
Config Complete]
J --> K[๐ค Auto Run]
K --> L[๐ท๏ธ Crawl 11+ platforms]
L --> M[๐ Keyword filtering]
M --> N[โ๏ธ Weight sorting<br/>Rank 60% + Freq 30% + Hot 10%]
N --> O[๐ Generate reports<br/>HTML + Push messages]
O --> P[๐ฑ Multi-channel push]
P --> Q[๐ Receive precise push<br/>Say goodbye to info overload]
style A fill:#e3f2fd
style B fill:#f3e5f5
style D fill:#fff3e0
style F fill:#fff9c4
style G fill:#e8f5e9
style H fill:#e0f2f1
style I fill:#fce4ec
style O fill:#e1bee7
style Q fill:#c8e6c9
```
GPL-3.0 License