From 97622ce0301e17cf93ab9cafa56395737b83ffd4 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Wed, 7 Jan 2004 11:59:07 +0000 Subject: [PATCH] Somewhat improved --- maintenance/rcdumper.php | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/maintenance/rcdumper.php b/maintenance/rcdumper.php index a90497d852..23a928faf3 100755 --- a/maintenance/rcdumper.php +++ b/maintenance/rcdumper.php @@ -1,10 +1,13 @@ rc_timestamp; while (1) { $res = wfQuery( "SELECT * FROM recentchanges WHERE rc_timestamp>'$oldTimestamp' ORDER BY rc_timestamp", DB_READ ); + $rowIndex = 0; while ( $row = wfFetchObject( $res ) ) { $ns = $wgLang->getNsText( $row->rc_namespace ) ; if ( $ns ) { @@ -59,7 +61,15 @@ while (1) { $comment = str_replace($bad, $empty, $comment); $title = str_replace($bad, $empty, $title); $user = str_replace($bad, $empty, $row->rc_user_text); - $url = "http://$lang.wikipedia.org/wiki/" . urlencode($title); + $lastid = IntVal($row->rc_last_oldid); + $flag = ($row->rc_minor ? "M" : "") . ($row->rc_new ? "N" : ""); + if ( $row->rc_new ) { + $url = "http://$lang.wikipedia.org/wiki/" . urlencode($title); + } else { + $url = "http://$lang.wikipedia.org/w/wiki.phtml?title=" . urlencode($title) . + "&diff=0&oldid=$lastid"; + } + $boldTitle = $fmB . str_replace("_", " ", $title) . $fmB; if ( $patterns ) { foreach ( $patterns as $pattern ) { @@ -68,9 +78,19 @@ while (1) { break; } } - } - print( "$url ($user) $comment\n" ); + } + if ( $comment !== "" ) { + $comment = "($comment)"; + } + + $fullString = "$boldTitle $flag $url $user $comment\n"; + + if ( $fullString{0} == "/" ) { + $fullString = " $fullString"; + } + print( $fullString ); $oldTimestamp = $row->rc_timestamp; + sleep(1); } sleep(5); } -- 2.20.1