<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);
date_default_timezone_set('America/New_York');

$stats_url = 'http://cr3.broadcasturself.com:6969/status-json.xsl';

$json = @file_get_contents($stats_url);
if (!$json) {
  echo 'Unable to fetch stream info.';
  return;
}

$data = json_decode($json, true);
if (!isset($data['icestats']['source'])) {
  echo 'No source data available.';
  return;
}

$source = $data['icestats']['source'];
$title = isset($source['title']) ? trim($source['title']) : '';

echo $title !== '' ? $title : 'No track info available.';
?>
