You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
1.0 KiB
26 lines
1.0 KiB
<?php
|
|
|
|
#$sToken = "CAT8zTYoi09uF6B8Q9At5mzUSerZO7Y5JSqUIRtsRDe"; // ใส่ Token ที่ได้จาก Line Notify
|
|
$sToken = "4XcWd2eMfN6C0ACNRALwKzJNYCSNzHr6aAQeED7hJrk"; #Owen個人單個帳號測試
|
|
#$sToken = "lI2Cya7tSRjg8Rpolgd1UwuLhsXjwfWNtwLEEwUGlBw"; #工作小助手
|
|
$sMessage = "賀成交!!!最新業績排行榜如下。" . "\n";
|
|
$sMessage .= "http://www.masada.com.tw" . "\n";
|
|
#$sMessage .= "Second " . "\n";
|
|
|
|
$chOne = curl_init();
|
|
curl_setopt( $chOne, CURLOPT_URL, "https://notify-api.line.me/api/notify");
|
|
curl_setopt( $chOne, CURLOPT_SSL_VERIFYHOST, 0);
|
|
curl_setopt( $chOne, CURLOPT_SSL_VERIFYPEER, 0);
|
|
curl_setopt( $chOne, CURLOPT_POST, 1);
|
|
curl_setopt( $chOne, CURLOPT_POSTFIELDS, "message=".$sMessage);
|
|
$headers = array( 'Content-type: application/x-www-form-urlencoded', 'Authorization: Bearer '.$sToken.'', );
|
|
curl_setopt($chOne, CURLOPT_HTTPHEADER, $headers);
|
|
curl_setopt( $chOne, CURLOPT_RETURNTRANSFER, 1);
|
|
$result = curl_exec( $chOne );
|
|
|
|
if($result){
|
|
echo "Success!";
|
|
}else{
|
|
echo "Failure!";
|
|
}
|
|
?>
|