Commit 9478b20c by 陈森彬

切换微信告警机器人

parent 58ef3131
Showing with 6 additions and 3 deletions
......@@ -8,18 +8,20 @@ import requests
dd_robot_api = ' https://oapi.dingtalk.com/robot/send?access_token='
tom = 'c19beeab837f5c6e019e7fc602d470704d634ae33510f40fb0e903cde215fb24'
msgapi_url = 'http://api.ichunt.com/msg/sendMessageByAuto'
wechat_robot_api = "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key="
tom_key = "bb2b5b4e-9a06-4d3d-89f5-61bcf07ed4ba"
def dd_send_msg(msg, robot=tom):
def dd_send_msg(msg, robot=tom_key):
data = {
"msgtype": "text",
"text": {
"content": msg
}
}
requests.post(dd_robot_api + robot, json=data)
requests.post(wechat_robot_api + robot, json=data)
time.sleep(5)
if 'digikey' in msg:
content = 'digikey token同步失败'
cur_time = int(time.time())
m = hashlib.md5()
......@@ -32,5 +34,6 @@ def dd_send_msg(msg, robot=tom):
'ex_str': '', 'k2': d.hexdigest(), 'k1': str(cur_time)}
requests.post(msgapi_url, data=data)
if __name__ == "__main__":
dd_send_msg('digikey喂喂 你发的太多了!')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment