群晖通知发送到微信

<?php
$num = $_GET['num'];
$passwd = $_GET['passwd'];
$content = $_GET['title'];
$msg = $_GET['description'];
$url = $_GET['null.com'];
function curlPost($url,$data=""){   
    $ch = curl_init();
    $opt = array(
            CURLOPT_URL     => $url,            
            CURLOPT_HEADER  => 0,
            CURLOPT_POST    => 1,
            CURLOPT_POSTFIELDS      => $data,
            CURLOPT_RETURNTRANSFER  => 1,
            CURLOPT_TIMEOUT         => 20
    );
    $ssl = substr($url,0,8) == "https://" ? TRUE : FALSE;
    if ($ssl){
        $opt[CURLOPT_SSL_VERIFYHOST] = 1;
        $opt[CURLOPT_SSL_VERIFYPEER] = FALSE;
    }
    curl_setopt_array($ch,$opt);
    $data = curl_exec($ch);
    curl_close($ch);
    return $data;
}
$corpid="11111";       //企业id
$corpsecret="11111";       //企业secret
$Url="http://wxts.geekxw.top/cgi-bin/gettoken?corpid=$corpid&corpsecret=$corpsecret";
$res = curlPost($Url);
$ACCESS_TOKEN=json_decode($res)->access_token;
$Url="http://wxts.geekxw.top/cgi-bin/message/send?access_token=$ACCESS_TOKEN";
$data="{\"touser\":\"@all\",\"msgtype\":\"text\",\"agentid\":1000004,\"text\":{\"content\":\"$content\n$msg$url\"},\"safe\":0}"; //此处ID需要修改,1000004修改为自己应用id
$res = curlPost($Url,$data);
$errmsg=json_decode($res)->errmsg;
if($errmsg==="ok"){
    echo "发送成功
    by:小陈折腾日记!
    B站:https://space.bilibili.com/22447499";
}else{
    echo "by:小陈折腾日记!
    B站:https://space.bilibili.com/22447499
    发送失败,".$errmsg;
}
?>

效果如图

待更新

评论

  1. B站粉丝
    Windows Edge 123.0.0.0
    2周前
    2024-4-10 9:58:56

    催更 最好详细一点(╯‵□′)╯︵┴─┴

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇