Talk:Logfile of the 2006-05-19 IRC session

From GregariusWiki

Jump to: navigation, search

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";
	}
}
?>
Personal tools
Advertisement