Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Stream Page

Featured Replies

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.

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 by PeterBooker

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.