最近在服务器上运行任务,任务完成后希望在手机上收到通知。
实现方法:用ntfy监控进程的运行情况,然后将信息传送到pushplus的推送接口,在微信上便会收到通知。
1.配置pushplus
在pushplus的官网(pushplus(推送加) - 消息推送平台)注册账号获取推送接口的token。注册过程会提示关注微信公众号并激活消息推送功能,按说明操作。在网站的调用方式栏注明HTTP GET方式的请求地址是
http://www.pushplus.plus/send?token=XXX&title=XXX&content=XXX&template=html
其中XXX就是在ntfy中要替换的信息了,这里先保留。至此配置好pushplus。
2.配置ntfy
ntfy项目在Github上的地址dschep/ntfy: 🖥️📱🔔 A utility for sending notifications, on demand and when commands finish. (github.com)