2 include_once('/var/www/secure.php');
3 function slack_general($msg,$room){
5 $room = str_replace("'",'-',strtolower(str_replace(' ','-',$room)));
7 $add = "[".$_SERVER['PHP_SELF']."] ";
10 //$version = "[".getenv('RELEASE')."] ";
11 //$msg = $version.$msg;
12 $msg = str_replace('http://','_______',$msg);
13 $msg = str_replace('https://','________',$msg);
14 $msg = str_replace('.net','____',$msg);
15 $msg = str_replace('.com','____',$msg);
16 $msg = urlencode($msg);
19 if (isset($_COOKIE['name'])){
20 $name = str_replace("'",'-',strtolower(str_replace(' ','-',$_COOKIE['name'])));
25 $url = "https://slack.com/api/channels.create?token=$token&name=$thisroom&pretty=1";
27 curl_setopt ($curl, CURLOPT_URL, $url);
28 curl_setopt ($curl, CURLOPT_TIMEOUT,"2");
29 curl_setopt ($curl, CURLOPT_USERAGENT, sprintf("McGuire/%d.0",rand(18,40)));
30 curl_setopt ($curl, CURLOPT_RETURNTRANSFER, 1);
31 curl_setopt ($curl, CURLOPT_SSL_VERIFYPEER, 0);
32 $html = curl_exec ($curl);
37 $url = "https://slack.com/api/chat.postMessage?token=$token&channel=$thisroom&text=$msg";
39 curl_setopt ($curl, CURLOPT_URL
, $url);
40 curl_setopt ($curl, CURLOPT_TIMEOUT
,"2");
41 curl_setopt ($curl, CURLOPT_USERAGENT
, sprintf("McGuire/%d.0",rand(18,40)));
42 curl_setopt ($curl, CURLOPT_RETURNTRANSFER
, 1);
43 curl_setopt ($curl, CURLOPT_SSL_VERIFYPEER
, 0);
44 $html = curl_exec ($curl);