Embykeeper + pushplus:签到保号结果推到微信
效果:签到或保号任务跑完后,微信收到成功或失败摘要,不用翻终端或 Telegram 记录。
Embykeeper 没有内置 pushplus 界面。在启动命令外包一层 curl,或在你现有的 notify 钩子里调 /send。
前置条件
- 一个 pushplus token(官网扫码获取)
- 已能在本机或容器里跑通 Embykeeper
配置步骤
- 写包装脚本(systemd
ExecStart、cron、dockerentrypoint都适用):
#!/bin/sh
if embykeeper "$@"; then
status="成功"
else
status="失败"
fi
curl -s -X POST "https://www.pushplus.plus/send" \
-H "Content-Type: application/json" \
-d "{\"token\":\"${PUSH_PLUS_TOKEN}\",\"title\":\"Embykeeper ${status}\",\"content\":\"args=$* result=${status}\",\"template\":\"markdown\"}"
- token 用环境变量
PUSH_PLUS_TOKEN。content必填。 - 若配置文件里已有「自定义通知命令 / webhook URL」一类项:能自定义 JSON 就 POST
/send;只能填 URL 则用 GET 固定文案:
https://www.pushplus.plus/send?token=你的token&title=Embykeeper任务结束&content=请查看Embykeeper日志
不要把软件默认 POST 的 JSON 直接指向 /send。完整字段见 消息接口。
验证
curl -X POST "https://www.pushplus.plus/send" \
-H "Content-Type: application/json" \
-d '{"token":"你的token","title":"Embykeeper 配置测试","content":"token 可用","template":"markdown"}'
再手动跑一次签到任务走包装脚本。
常见问题
任务有日志、微信没有? 确认进程是通过包装脚本拉起的,且环境变量已注入。见 收不到消息、接口限制。
每天多次签到刷屏? 只在失败时推,或把成功结果合并成一天一条。