Advertisement
Guest User

Dust514 Directy Code on Twitch.tv

a guest
Apr 11th, 2013
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. <h1>Dust 514 streams on Twitch.tv</h1>
  2.  
  3. <?php
  4.  
  5. $json = file_get_contents("http://api.justin.tv/api/stream/list.json?category=gaming&meta_game=Dust%20514");
  6.  
  7. $elements = json_decode($json);foreach ($elements as $element) {
  8.  
  9. /*$channel = get_object_vars($element->channel);
  10. print_r(array_keys($channel)); // Use this to print out all available keys for the channel array */
  11.  
  12. echo '<strong>', $element->title, '</strong> | '; // Prints out stream title
  13.  
  14. echo $element->stream_count, '<br />'; // Prints out stream viewer count
  15.  
  16. echo '<a href="', $element->channel->channel_url, '">'; // Enables hyperlink to channel
  17. echo '<img border="0" width="194" height="110" src="', $element->channel->screen_cap_url_large, '" />'; // Prints out an image
  18. echo '</a>'; //$element->channel->embed_code; // Prints out a embedded flash video
  19.  
  20.  
  21. echo '<br /><br />';}
  22. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement