MLIA function for PHP IRC Bots

By _Ice_ on Dec 16, 2009

This code should work with minor tweaking on any php irc bot on hawkee
Usage: Mlia($varForChannel);

function Mlia($channel){
    $mlianumber = rand(0,436672);
    $mliapage = file_get_contents("http://mylifeisaverage.com/s/$mlianumber");
    $pattern = "<div class=\"sc\">(.|[\r\n])*?<\/div>";
preg_match("/$pattern/i",$mliapage,$match);
$match = $match[0];
$match = str_replace ("<div class=\"sc\">","",$match);
$match = str_replace ("</div>","",$match);
$match = str_replace ("\n","",$match);
$match = str_replace ("\r","",$match);
$match = trim($match);
$string = "4MLIA:1 $match";
send("PRIVMSG",$channel,$string);
}

Comments

Sign in to comment.
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.