Refactor the cron job functionality to transition from a crawling to a searching model. Update related documentation and scripts to reflect the new terminology and functionality, including changes in the README and script comments. Enhance WeChat menu and message handling to support the new search features, ensuring clarity in user interactions and logging.

This commit is contained in:
2026-01-09 08:19:09 +08:00
parent 4000438f49
commit 72dc40186d
20 changed files with 5935 additions and 595 deletions
+7 -7
View File
@@ -1,11 +1,11 @@
# 定时爬取脚本使用说明
# 定时搜索脚本使用说明
## 脚本功能
`cron_crawl.py` 是一个用于定时爬取广西政府采购网公告的脚本,具有以下功能:
`cron_crawl.py` 是一个用于定时搜索广西政府采购网公告的脚本,具有以下功能:
- ✅ 从 `gx_gp_monitor/config/config.yaml` 读取关键词配置
-爬取最新的公告(数据库中没有的)
-搜索最新的公告(数据库中没有的)
- ✅ 自动筛选匹配关键词的公告
- ✅ 将筛选结果保存到数据库
- ✅ 以卡片形式发送企业微信通知
@@ -16,7 +16,7 @@
project/
├── venv/ # Python虚拟环境
├── gx_gp_monitor/
│ ├── cron_crawl.py # 定时爬取主脚本
│ ├── cron_crawl.py # 定时搜索主脚本
│ └── config/config.yaml # 配置文件
├── run_cron_crawl.sh # 启动脚本(自动激活虚拟环境)
├── CRON_README.md # 使用说明
@@ -62,8 +62,8 @@ crontab -e
### 3. 脚本输出示例
```
=== 定时爬取任务完成 ===
总共爬取: 1300 条公告
=== 定时搜索任务完成 ===
总共搜索: 1300 条公告
新增公告: 5 条
关键词筛选: 2 条
保存到数据库: 2 条
@@ -135,7 +135,7 @@ tail -f /home/v6ole/pyproject/GX-gp-notify/logs/cron.log
4. **时区设置**:确保系统时区设置正确,影响定时任务执行时间
5. **资源消耗**爬取过程中会消耗一定的CPU和网络资源,建议在非高峰期运行
5. **资源消耗**搜索过程中会消耗一定的CPU和网络资源,建议在非高峰期运行
## 故障排除