Created
August 24, 2018 21:57
Revisions
-
rbocchinfuso created this gist
Aug 24, 2018 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ // post message $message = "@$username is working on $text"; $data = "payload=" . json_encode(array( 'response_type' => $response_type, "text" => $message, "icon_emoji" => $icon )); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, SLACK_WEBHOOK); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); $result = curl_exec($ch); // var_dump($result); if($result === false) { echo 'Curl error: ' . curl_error($ch); } curl_close($ch); // send ephemeral notification let user know that thier echo "@$username you've let everyone on #the-railroad know you are working on $text";