Optimized code
This commit is contained in:
@@ -10,6 +10,7 @@ from pushplus import send_message
|
|||||||
url = os.environ.get("URL")
|
url = os.environ.get("URL")
|
||||||
username = os.environ.get("USERNAME")
|
username = os.environ.get("USERNAME")
|
||||||
password = os.environ.get("PASSWORD")
|
password = os.environ.get("PASSWORD")
|
||||||
|
token = os.environ.get("TOKEN")
|
||||||
|
|
||||||
|
|
||||||
# 定义一个md5加密的封装函数
|
# 定义一个md5加密的封装函数
|
||||||
|
|||||||
+1
-3
@@ -1,10 +1,8 @@
|
|||||||
import requests
|
import requests
|
||||||
import json
|
import json
|
||||||
import os
|
|
||||||
|
|
||||||
|
|
||||||
def send_message(title, content):
|
def send_message(token, title, content):
|
||||||
token = os.environ.get("TOKEN")
|
|
||||||
url = "http://www.pushplus.plus/send"
|
url = "http://www.pushplus.plus/send"
|
||||||
data = {"token": token, "title": title, "content": content}
|
data = {"token": token, "title": title, "content": content}
|
||||||
body = json.dumps(data).encode(encoding="utf-8")
|
body = json.dumps(data).encode(encoding="utf-8")
|
||||||
|
|||||||
Reference in New Issue
Block a user