';
foreach ( $sked_json as $game ) {
$date = $game->est;
$game_date = date( 'Ymd', strtotime( $date ) );
if( $game_date != $todays_date ) {
continue;
}
$game_id = substr( $game->id, -4 );
$streams = file_get_contents( 'http://smb.cdnak.neulion.com/fs/nhl/mobile/feed_new/data/streams/2013/ipad/02_'.$game_id.'.json' );
$streams_json = json_decode( $streams );
$output .= '';
$output .= $game->a . ' @ ' . $game->h . ' - ' . date( 'g:i a', strtotime( $game->est) ) . ' EST';
$output .= '';
if( !isset( $streams_json->gameStreams->ipad->away->live ) ) {
$output .= '- No streams available yet. Check back soon
';
} else {
$stream_a = $streams_json->gameStreams->ipad->away->live->bitrate0;
$stream_h = $streams_json->gameStreams->ipad->home->live->bitrate0;
$output .= '- ' . $game->a;
$output .= '
';
$output .= '- ' . $stream_a . '
';
$output .= '- ' . preg_replace( '/ipad/i', '4500', $stream_a ) . '
';
$output .= '- ' . preg_replace( '/ipad/i', '3000', $stream_a ) . '
';
$output .= '- ' . preg_replace( '/ipad/i', '1600', $stream_a ) . '
';
$output .= '
';
$output .= ' ';
$output .= '- ' . $game->h;
$output .= '
';
$output .= '- ' . $stream_h . '
';
$output .= '- ' . preg_replace( '/ipad/i', '4500', $stream_h ) . '
';
$output .= '- ' . preg_replace( '/ipad/i', '3000', $stream_h ) . '
';
$output .= '- ' . preg_replace( '/ipad/i', '1600', $stream_h ) . '
';
$output .= '
';
$output .= ' ';
}
$output .= '
';
$output .= '';
}
$output .= '';
echo $output;
?>