Skip to content

Instantly share code, notes, and snippets.

@albertohm
Last active December 29, 2015 09:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save albertohm/7651186 to your computer and use it in GitHub Desktop.
Save albertohm/7651186 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<link type='text/css' rel='stylesheet' href='style.css'/>
<title>Hello, World!</title>
</head>
<body>
<?php
require 'sda_stream.php';
$streams = SDAStream::get(
array(
'channels' => array( 'starblex', 'bluu858', 'channel3' ),
'api' => 'justin'
)
);
foreach ($streams->results as $entry) {
$status = ($entry['online'] === true) ? 'Online' : 'Offline';
echo "<a href='{$entry[channel_url]}'>{$entry[user_name]}</a> is $status.<br/>";
echo "<p>";
echo "<object type='application/x-shockwave-flash' height='169' width='310' id='live_embed_player_flash' data='http://www.twitch.tv/widgets/live_embed_player.swf?channel={$entry[user_name]}' bgcolor='#000000'>
<param name='allowFullScreen' value='true' />
<param name='allowScriptAccess' value='always' />
<param name='allowNetworking' value='all' />
<param name='movie' value='http://www.twitch.tv/widgets/live_embed_player.swf' />
<param name='flashvars' value='hostname=www.twitch.tv&channel={$entry[user_name]}&auto_play=true&start_volume=25' />
</object>";
echo "</p>";
}
?>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment