diff --git a/main.py b/main.py index 984caa2..0e76a5d 100644 --- a/main.py +++ b/main.py @@ -10,6 +10,7 @@ from pushplus import send_message url = os.environ.get("URL") username = os.environ.get("USERNAME") password = os.environ.get("PASSWORD") +token = os.environ.get("TOKEN") # 定义一个md5加密的封装函数 diff --git a/pushplus.py b/pushplus.py index 6ae6bdf..2155067 100644 --- a/pushplus.py +++ b/pushplus.py @@ -1,10 +1,8 @@ import requests import json -import os -def send_message(title, content): - token = os.environ.get("TOKEN") +def send_message(token, title, content): url = "http://www.pushplus.plus/send" data = {"token": token, "title": title, "content": content} body = json.dumps(data).encode(encoding="utf-8")