pRoLuCkY:
.tcl:
Code:
bind msgm - [PRE]* procpre
proc procpre {nick uhost handle text} {
set query [http::formatQuery "rls" $text]
set url "http://your_ip/pretime.php?$query"
putlog "url: $url"
set result [http::data [http::geturl $url -timeout 5000]]
putlog "$result"
}
pretime.php:
Code:
<?
mysql_connect("localhost", "user", "password");
mysql_select_db("pretimes_db");
ereg("\[PRE\] - ([a-zA-Z0-9\._-]*). in .([a-zA-Z0-9\._-]*)",$rls,$regs);
$release = $regs[1];
$type = $regs[2];
$time = time();
if ($type!="" && $release!="") {
$sql = "INSERT INTO pretimes (timestamp, type, name) VALUES ('$time', '$type', '$release')";
mysql_query($sql)
or die($sql."<br>\n".mysql_error());
echo "Release '$release' succesfully added as $type";
}