IRC notifier

This commit is contained in:
Latif Khalifa
2013-10-04 08:12:26 +02:00
parent da13fdf4ee
commit 1000c4d743
5 changed files with 39 additions and 4 deletions

27
htdocs/lib/IRCNotify.php Normal file
View File

@@ -0,0 +1,27 @@
<?php
class IRCNotify
{
function http_post($url, $fields)
{
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$res = curl_exec($ch);
curl_close($ch);
return $res;
}
function send($chan, $msg)
{
$fields = array(
"chan" => $chan,
"auth" => file_get_contents(SITE_ROOT . '/lib/irc_passwd'),
"msg" => $msg
);
self::http_post("http://messi.streamgrid.net/~lkalif/lolabot.php", $fields);
}
}