#!/usr/bin/php 'Jerkstore Nethack RSS', 'link' => 'http://sadowl.com/', 'description' => 'A list of nethack deaths by jerks', ); // Parse the logfile line by line $log = `cat <$pathToLogfile | grep -v quit`; foreach (explode("\n", $log) as $line) { preg_match('/^\S+ (\d+) .* (\S+),(\w.+)$/', $line, $matches); list($whole, $score, $user, $death) = $matches; if (!$user) continue; $XML .= " R.I.P. $user ($score points)$death\n"; } // Now stick it all into an RSS 2.0 XML doc $XML = " $rssConfig[title] $rssConfig[link] $rssConfig[description] $XML "; print($XML); ?>