Talk:Logfile of the 2006-05-19 IRC session
From GregariusWiki
Colloquy logfile to text:
<?php
$doc = simplexml_load_file('gregarius.colloquyTranscript');
foreach($doc -> envelope as $e) {
$s = $e->sender;
foreach ($e -> message as $m) {
if (isset($m->span)) {
$span = $m->span;
} else { $span = ''; }
$sep ="\t- ";
foreach($m -> attributes() as $a => $v) {
if ('action' == $a) {
$action = true;
$sep = " ";
}
}
echo $s .$sep . $span . $m ."\n";
}
}
?>

