08 - 微信推送服务(GitHub Actions 自动推送)
一、项目简介
每日自动推送国际新闻简报 + AI推文日报到微信(通过 PushPlus 推送)。
二、项目位置
~/Desktop/news-push/
├── news_push.py ← 新闻简报脚本(早8点)
├── tweet_fetch.py ← AI推文日报脚本(晚8点)
└── .github/workflows/daily_news.yml ← GitHub Actions定时配置
三、定时设置
| 任务 | cron(UTC) | 北京时间 | 说明 |
|---|---|---|---|
| 新闻简报 | 0 0 * * * |
08:00 | 国际主要媒体新闻 |
| AI推文日报 | 0 12 * * * |
20:00 | AI大佬推特动态汇总 |
⚠️ 注意:GitHub Actions 免费版有时间延迟,偶尔可能不准时。
四、技术原理
GitHub Actions(定时触发)
↓
GitHub 服务器运行 Python 脚本
↓
抓取:BBC / AP News / Guardian / Al Jazeera / Reuters
↓
翻译:MyMemory API(英→中)
↓
推送到:PushPlus(微信)
↓
你收到微信消息
五、推送渠道:PushPlus
- 官网:https://www.pushplus.plus
- 原理:PushPlus 提供微信消息推送 API
- Token 存在 GitHub Secrets 中(
PUSHPLUS_TOKEN)
六、媒体来源
| 来源 | 抓取范围 | 翻译 |
|---|---|---|
| BBC | 俄乌战争板块 | 英→中 |
| AP News | 俄乌战争板块 | 英→中 |
| Al Jazeera | 中东/伊朗板块 | 英→中 |
| Guardian | 乌克兰/国际板块 | 英→中 |
| Reuters | RSS订阅 | 英→中 |
| Twitter/X | 指定AI/区块链领域大佬 | 英→中 |
七、定时配置说明(修改时间方法)
配置在 daily_news.yml 中:
on:
schedule:
# 格式:分钟 小时 日 月 星期
- cron: '0 0 * * *' # UTC 0:00 = 北京 8:00
- cron: '0 12 * * *' # UTC 12:00 = 北京 20:00
cron 语法:
*= 任意0 8 * * *= 每天UTC 8:00(北京16:00)30 1 * * *= 每天UTC 1:30(北京9:30)
八、半夜1点收到推送的原因
非定时设置,可能原因:
- GitHub Actions排队延迟(免费版常见)
- 手动触发了
workflow_dispatch - 之前测试时遗留下的运行
查看实际运行记录:https://github.com/jackieliu5980186/news-push/actions
九、GitHub 仓库
- 仓库名:
news-push - 地址:https://github.com/jackieliu5980186/news-push
文档位置:~/knowledge-base/今通国际马来项目/08-微信推送服务说明.md 最后更新:2026年5月
马来西亚今通国际(今日天下通)B2B平台海外拓展项目知识库 · 最后更新:2026年5月