#!/usr/bin/python
#-*- coding: utf-8 -*-
 
import requests
import json
import sys
import os
 
 
 
api_url="https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=95a685d3-ac42-406f-8393-ffcd0c406f7c"
#api_url="https://www.fc.jxhcxc.com/index.php/human/index/webhook"
headers = {'Content-Type': 'application/json;charset=utf-8'}
 
def msg(user,subject,text):
    json_text = {
        "msgtype": "text",
        "text": {
            "content": subject + '\n' + text
 
        },
    }
    print(requests.post(api_url, json.dumps(json_text), headers=headers).content)
 
if __name__ == '__main__':
    user = str(sys.argv[1])
    subject = str(sys.argv[2])
    text = str(sys.argv[3])
    #user = "tt"
    #subject = "test"
    #text = "hello zjh-zabbix-wechat-webhook "
msg(user,subject,text)
