Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $stream_list = "TobiWanDota,xancara,jd_epi,dendi";
- $mycurl = curl_init();
- curl_setopt ($mycurl, CURLOPT_HEADER, 0);
- curl_setopt ($mycurl, CURLOPT_RETURNTRANSFER, 1);
- //Build the URL
- $url = "http://api.justin.tv/api/stream/list.json?channel=" . $stream_list;
- curl_setopt ($mycurl, CURLOPT_URL, $url);
- $web_response = curl_exec($mycurl);
- $results = json_decode($web_response);
- $streamnum = 1;
- foreach($results as $s) {
- echo "<div id=\"stream\">";
- echo "<div id=\"user\">#$streamnum " . $s->channel->login;
- echo "<div id=\"viewers\"> " . $s->channel_count . " viewers </div></div>\n<br />";
- echo "<div id=\"title\">" . $s->title . "</div></td>\n<br />";
- echo "<a target=\"_parent\" href=\"http://www.abyssgaming.us/livestream#" . $s->channel->login . "\">";
- echo "<div id=\"screen\"><img src=\"" . $s->channel->screen_cap_url_medium . "\"></img></div>\n</a>";
- echo "</div>";
- $streamnum++;
- }
- if (count($results) > 0) { echo ''; }
- else echo "<div id=\"offline\"><h1>Sorry, all of our streams are offline. Check out <a href=\"http://www.twitch.tv\">twitch</a> directly.</h1></div>";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment