Zdravím,
mám tento script
public function sendTo($channel,$message){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"https://hooks.slack.com/services/...");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,
'payload={"username":"Bot","text":"'.$message.'","channel":"'.$channel.'"}');
// receive server response ...
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$server_output = curl_exec ($ch);
curl_close ($ch);
// further processing ....
//if ($server_output == "OK") { ... } else { ... }
}
a potřebuji, aby fungoval tak, že když zadám url: http://example.com/my-script.php?…
tak to pošle zprávu na slack.
Děkuji za pomoc :)