Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <h1>Dust 514 streams on Twitch.tv</h1>
- <?php
- $json = file_get_contents("http://api.justin.tv/api/stream/list.json?category=gaming&meta_game=Dust%20514");
- $elements = json_decode($json);foreach ($elements as $element) {
- /*$channel = get_object_vars($element->channel);
- print_r(array_keys($channel)); // Use this to print out all available keys for the channel array */
- echo '<strong>', $element->title, '</strong> | '; // Prints out stream title
- echo $element->stream_count, '<br />'; // Prints out stream viewer count
- echo '<a href="', $element->channel->channel_url, '">'; // Enables hyperlink to channel
- echo '<img border="0" width="194" height="110" src="', $element->channel->screen_cap_url_large, '" />'; // Prints out an image
- echo '</a>'; //$element->channel->embed_code; // Prints out a embedded flash video
- echo '<br /><br />';}
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement