HOME

Wednesday, December 15, 2010

test of a live indicator

[url]http://roflmayonaise.net/getlive.php?channel=tallasseetimes&showviewers=true[/url]


load("http://tallasseetimes.api.tallasseetimes.livestream.com/2.0/livestatus.xml");

//make sure path is correct
$channel = $objDOM->getElementsByTagName("channel");
foreach( $channel as $value )
{
$isLives = $value->getElementsByTagName("isLive");
$isLive = $isLives->item(0)->nodeValue;
$viewers = $value->getElementsByTagName("currentViewerCount");
$viewer = $viewers->item(0)->nodeValue;
}

if($isLive == "true")
{
echo "Online";
echo " | Viewers: " . $viewer;
}
else
{
echo "Offline";
echo " | Viewers: " . $viewer;
}
?>