September 7, 201214 yr Hey, You guys have helped me a lot in the past, so wanted to come here for more. I wanted to make a live stream page that has multiple links to live streams but orders them in how many viewers they each have and doesn't show them if the stream isn't currently live. Here is an example: http://www.lolking.net/streams Another example: http://www.solomid.net/streams.php Any help like this would be awesome. I believe I know how to do it like it is in the first link, but I'm not sure how to separate the online and offline ones.
September 10, 201214 yr I just did this on a site of mine, ns2hub.com I currently only support twitch.tv as that seems to be used most frequently, by far. The important thing you need with twitch is this: http://api.justin.tv...mit=100channel= You can then add the channel usernames, seperated by commas upto a limit of 100. This will turned an xml file with data for any streams that are online. I use whether or not data is returned to check the online status of streams. This is a basic version of what I use: $url = "http://api.justin.tv/api/stream/list.xml?limit=100&channel=$names"; $xml = simplexml_load_file($url); foreach($xml as $item) { //example usage $current_viewers = $item->channel_count; } I hope this gets you started in the right direction, if you have any specific questions just shout! Edited September 10, 201214 yr by PeterBooker
Create an account or sign in to comment