微信curl调用

时间:2017-03-16 22:51:10   收藏:0   阅读:420
#!/bin/bash
##################
#
# author: will
# createdate: 20170314
# function: 
#
##################
a=$1
b=$2
china()
{
####visachina告警
CropID=‘xxxx‘
Secret=‘xxxx‘
topartyID=2
agentidID=1
text=`cat $b`

###获取token
token=`curl -s https://qyapi.weixin.qq.com/cgi-bin/gettoken?co"rpid=${CropID}&corpsecret=${Secret}" | awk -F ‘\"‘ ‘{print $4}‘`

###发送消息
curl -d ‘{"toparty":"‘${topartyID}‘","agentid":"‘${agentidID}‘","msgtype":"text","text":{"content":"‘"${text}"‘"}}‘ https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token="${token}"
}

$a


本文出自 “zengs” 博客,请务必保留此出处http://zengs.blog.51cto.com/939838/1907150

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!