日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

微信企业号:shell定时发送图片 到 指定人

發(fā)布時間:2025/7/14 编程问答 21 豆豆
生活随笔 收集整理的這篇文章主要介紹了 微信企业号:shell定时发送图片 到 指定人 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 #!/bin/bash #返回access?token function?getToken(){?#傳入?yún)?shù)$1為corpid,參數(shù)$2為corpsecret ????curl?-s?"https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=$1&corpsecret=$2"?|?awk?-F?'"'?'{print?$4}' } #返回media_id function?getMediaId(){?#傳入?yún)?shù)$1為access?token;參數(shù)$2為圖片文件 ????curl?-s?-F?media=@$2?"https://qyapi.weixin.qq.com/cgi-bin/media/upload?access_token=$1&type=image"?|?awk?-F?'"'?'{print?$8}' } #發(fā)送文字消息 function?sendText(){?#傳入?yún)?shù)$1為access?token,$2為消息內(nèi)容,$3指定接收消息的賬號 ????curl?-d?'{"touser":?"'$3'",?"msgtype":?"text",?"agentid":?0,?"text":?{"content":?"'$2'"},?"safe":"0"}'??"https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=$1" } #發(fā)送圖片消息 function?sendImage(){?#傳入?yún)?shù)$1為access?token;參數(shù)$2為media_id,$3指定接收消息的賬號 ????postdata='{"touser":?"'$3'",?"msgtype":?"image",?"agentid":?0,?"image":?{"media_id":?"'$2'"},?"safe":"0"}' ????curl?-d?"$postdata"??"https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=$1" } corpid='xxxxxxxxxx'?#使用前面記下來的值替換 corpsecret='xxxxxxxxxxxxxxxxxxxxxxxxxxxxx'??#使用前面記下來的值替換 image='test.png' text='這是發(fā)送的內(nèi)容' receiver='mer_aqu'?#此處為接收者的id,根據(jù)企業(yè)號后臺的設(shè)置(ID),可以是手機(jī)號、微信號或其它的。同時發(fā)送到多個關(guān)注者用“|”隔開。 token=`getToken?$corpid?$corpsecret` sendText?$token?$text?$receiver media_id=`getMediaId?$token?$image` sendImage?$token?$media_id?$receiver









本文轉(zhuǎn)自 295631788 51CTO博客,原文鏈接:http://blog.51cto.com/hequan/1899900,如需轉(zhuǎn)載請自行聯(lián)系原作者

總結(jié)

以上是生活随笔為你收集整理的微信企业号:shell定时发送图片 到 指定人的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。