Skip to content

Instantly share code, notes, and snippets.

@gig3m
Created August 26, 2011 20:12
Show Gist options
  • Save gig3m/1174311 to your computer and use it in GitHub Desktop.
Save gig3m/1174311 to your computer and use it in GitHub Desktop.
<?php
$url = "http://ventrilostatus.net/xml/nitrogen.typefrag.com:11101/";
//$xml = file_get_contents($url);
$xml = file_get_contents("source.xml");
$base = simplexml_load_string($xml);
$bold_pre = "\033[1;1m";
$bold_post = "\033[0m";
//print_r($array);
function printChild($array) {
foreach($array->children() as $child) {
if ($child->getName() == "channel") {
print("Channel: ".$child['name']." \n");
foreach($child->children() as $subchild) {
printChild($subchild);
}
}
elseif ($child->getName() == "client") {
print("Client: ".$child['name']." \n");
}
}
}
printChild($base);
?>
<?xml version="1.0" encoding="UTF-8"?>
<server name="Skrilla's Vent" phonetic="Skrilla's Vent" comment="http://www.typefrag.com/" auth="1" maxclients="10" uptime="1366877" platform="WIN32" version="3.0.6" channelcount="14" clientcount="3" voicecodec="Speex" voiceformat="32 KHz, 16 bit, 10 Qlty">
<channel cid="0" pid="-1" prot="0" name="Lobby" comm="">
<channel cid="215" pid="0" prot="0" name="AFK (Silence)" comm=""/>
<channel cid="217" pid="0" prot="0" name="Elitist Jerks" comm="">
<channel cid="223" pid="217" prot="0" name="Iceberg's Incubator" comm=""/>
<channel cid="224" pid="217" prot="0" name="Joo's Jiveturkey" comm="">
<client admin="1" cid="224" phan="0" ping="63" sec="15277" name="Joowantaxe" comm=""/>
<client admin="1" cid="224" phan="0" ping="47" sec="15590" name="Spiz" comm=""/>
</channel>
<channel cid="225" pid="217" prot="1" name="Kyultu's Kabosh" comm=""/>
<channel cid="226" pid="217" prot="0" name="Migoe's Menagerie" comm=""/>
<channel cid="227" pid="217" prot="1" name="Raskin's Room" comm=""/>
<channel cid="221" pid="217" prot="0" name="Skrilla's Sanctum" comm="">
<client admin="1" cid="221" phan="0" ping="15" sec="6660" name="Skrilla" comm=""/>
</channel>
<channel cid="228" pid="217" prot="0" name="Skrilla's Soundcheck" comm="http://bit.ly/9GEI2H"/>
<channel cid="222" pid="217" prot="0" name="Spiz's Spread" comm=""/>
</channel>
<channel cid="216" pid="0" prot="0" name="Public Channels" comm="">
<channel cid="218" pid="216" prot="0" name="1" comm=""/>
<channel cid="219" pid="216" prot="0" name="2" comm=""/>
<channel cid="220" pid="216" prot="0" name="3" comm=""/>
</channel>
</channel>
</server>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment