All pastes #403619 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-03-20 14:43 UTC
rendered paste body
if (ereg("^!world (.*)",$text,$a)) {

    $runescape_serverlist = str_replace("\n","",trim(file_get_contents("http://www.runescape.com/sln.ws")));
    if (preg_match("/World $a[1]<\/td><td>FULL<\/td><td class=.*>(.*?)<\/td><td class=.*>(.*?)<\/td>/is",$runescape_serverlist,$tulemus2)) {
        //echo("Server ".$a[1]." on täis [ ".$tulemus2[1]." + ".$tulemus2[2]." ]");
        // kanakuke edit..
        raw("PRIVMSG ".$opt." :Server [".$a[1]."] asub: ".$tulemus[2]." tüüp: ".$tulemus[3]." on täis (2000). ");
                      //asd
    } else if (!preg_match("/World $a[1]<\/a>/is",$runescape_serverlist)) {
        raw("PRIVMSG ".$opt." :Selline server puudub.. ".$a[1]." -_-");
    } else {
        $otsime_seda = "/<a href=\".*?\">World $a[1]<\/a><\/td><td>(.*?) Players<\/td><td class=\".*?\">(.*?)<\/td><td class=\".*?\">(.*?)<\/td>/is";
        preg_match($otsime_seda,$runescape_serverlist,$tulemus);
        raw("PRIVMSG ".$opt." :Info #World: [".$a[1]."] : ".$tulemus[1]." mängijat, asub: ".$tulemus[2]." tüüp: ".$tulemus[3]);
    }
}