mirror of
https://github.com/3288588344/toulu.git
synced 2025-12-16 15:00:14 +08:00
Update 好宝贝.py
This commit is contained in:
19
好宝贝.py
19
好宝贝.py
@@ -20,19 +20,30 @@ push_content = 'TL库\n\n'
|
|||||||
wxapp_token = 'AT_aTsJ*********' # wxpusher的APPToken
|
wxapp_token = 'AT_aTsJ*********' # wxpusher的APPToken
|
||||||
|
|
||||||
def wxpusher_send():
|
def wxpusher_send():
|
||||||
|
"""
|
||||||
|
发送消息到wxpusher
|
||||||
|
"""
|
||||||
headers = {'Content-Type': 'application/json;charset=utf-8'}
|
headers = {'Content-Type': 'application/json;charset=utf-8'}
|
||||||
data = {
|
data = {
|
||||||
"appToken": wxapp_token,
|
"appToken": wxapp_token,
|
||||||
"uids": [f"{push_token}"],
|
"uids": [push_token],
|
||||||
"topicIds": [],
|
"topicIds": [],
|
||||||
"summary": push_title,
|
"summary": push_title,
|
||||||
"content": push_content,
|
"content": push_content,
|
||||||
"contentType": 1,
|
"contentType": 1,
|
||||||
"verifyPay": False
|
"verifyPay": False
|
||||||
}
|
}
|
||||||
json_data = json.dumps(data)
|
|
||||||
response = requests.post('https://wxpusher.zjiecode.com/api/send/message', headers=headers, data=json_data)
|
try:
|
||||||
print(response.text, "\n")
|
response = requests.post('https://wxpusher.zjiecode.com/api/send/message', headers=headers, data=json.dumps(data))
|
||||||
|
|
||||||
|
# 获取响应的 JSON 数据
|
||||||
|
response_json = response.json()
|
||||||
|
|
||||||
|
print(f"wxpusher 推送: {response_json.get('msg', '没有返回 msg 字段')}")
|
||||||
|
|
||||||
|
except requests.exceptions.RequestException as e:
|
||||||
|
print(f"wxpusher 推送失败: {e}")
|
||||||
|
|
||||||
# 获取公告信息
|
# 获取公告信息
|
||||||
def get_announcement():
|
def get_announcement():
|
||||||
|
|||||||
Reference in New Issue
Block a user