Last active
November 19, 2019 09:22
-
-
Save notsobad/fc207e7092f69e8b32662eaa665e0af2 to your computer and use it in GitHub Desktop.
企业微信群机器人消息,python wx.py `now is date`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import json | |
import requests | |
API_URL = 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=XXXXXXXXXX' | |
def send_msg(msg): | |
obj = { | |
"msgtype": "text", | |
"text": { | |
"content": msg | |
} | |
} | |
r = requests.post(API_URL, data=json.dumps(obj)) | |
print r.json() | |
if __name__ == '__main__': | |
msg = ' '.join(sys.argv[1:]) | |
send_msg(msg) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment