Skip to content

Instantly share code, notes, and snippets.

@notsobad
Last active November 19, 2019 09:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save notsobad/fc207e7092f69e8b32662eaa665e0af2 to your computer and use it in GitHub Desktop.
Save notsobad/fc207e7092f69e8b32662eaa665e0af2 to your computer and use it in GitHub Desktop.
企业微信群机器人消息,python wx.py `now is date`
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