tableName( 'recentchanges' ); $res = $dbr->query( "SELECT rc_timestamp FROM $recentchanges ORDER BY rc_timestamp DESC LIMIT 1" ); $row = $dbr->fetchObject( $res ); $oldTimestamp = $row->rc_timestamp; $serverCount = 0; while (1) { $res = $dbr->query( "SELECT * FROM $recentchanges WHERE rc_timestamp>'$oldTimestamp' ORDER BY rc_timestamp" ); $rowIndex = 0; while ( $row = $dbr->fetchObject( $res ) ) { if ( ++$serverCount % 20 == 0 ) { print "/server $ircServer\n"; } $ns = $wgLang->getNsText( $row->rc_namespace ) ; if ( $ns ) { $title = "$ns:{$row->rc_title}"; } else { $title = $row->rc_title; } /*if ( strlen( $row->rc_comment ) > 50 ) { $comment = substr( $row->rc_comment, 0, 50 ); } else {*/ $comment = $row->rc_comment; // } $bad = array("\n", "\r"); $empty = array("", ""); $comment = str_replace($bad, $empty, $comment); $title = str_replace($bad, $empty, $title); $user = str_replace($bad, $empty, $row->rc_user_text); $lastid = IntVal($row->rc_last_oldid); $flag = ($row->rc_minor ? "M" : "") . ($row->rc_new ? "N" : ""); if ( $row->rc_new ) { $url = $newPageURLFirstPart . urlencode($title); } else { $url = $URLFirstPart . urlencode($title) . "&diff=0&oldid=$lastid"; } $title = str_replace("_", " ", $title); # see http://www.irssi.org/?page=docs&doc=formats for some colour codes. prefix is \003, # no colour (\003) switches back to the term default $fullString = "\00303$title\0037 $flag\00310 $url \0037*\003 $user \0037*\003 $comment\n"; print( $fullString ); $oldTimestamp = $row->rc_timestamp; sleep(2); } sleep(5); } exit(); ?>