Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <body>
<div class="row text-center">
  <img class="page-header" src=http://www.cufonfonts.com/site/makeimage?type=custom&text=tWitch%20stream&size=60&id=10421>
  </div>
  <div class="row text-center">
    <button id="all" class="btn btn-primary">View All</button>
    <button id="onlyLive" class="btn btn-primary">View Live</button>
    <button id="onlyOffline" class="btn btn-primary">View Non-Live</button><input id="addStreamInput" type="text" placeholder="Add Stream *Case Sensitive*">
 <button id="addStreamBtn" class="btn btn-primary" type="submit">
        <i class="glyphicon glyphicon-plus"></i>
      </button>
  </div>
    <div id="onlyLiveColumn">
      
  </div>
  
  <div id=streams>
  </div>
  
  <footer class="text-center">Created by <a href="https://slayapps.com">SlayApps</a> (Elliott Alexander)</footer>
</body>
              
            
!

CSS

              
                body {
  display: flex;
  flex-direction: column;
}
input {
  height: 32px;
}
              
            
!

JS

              
                $(document).ready(function(){
//First set up any variables
//Add any channel here that you want on the list
var streamersList = ["capcomfighters","iateyourpie","LCK1","ESL_SC2", "OgamingSC2", "cretetion", "freecodecamp", "habathcx", "RobotCaleb", "noobs2ninjas","Orange_HS"];

  
//create the unsorted list
function createList(){
  $("#all").addClass("disabled");
  $("#onlyLive").removeClass("disabled");
  $("#onlyOffline").removeClass("disabled");
    $("#streams").empty();
  streamersList.forEach(function(streamName){
    var call = 'https://wind-bow.gomix.me/twitch-api/channels/' + streamName + '?callback=?';
    
    $.getJSON(call, function(data){
      //create and move the variables to the html
      var url = data.url;
      var name = data.display_name;
      var logo = data.logo;
      var status = data.status;
      var labelSwitch = '';
      var labelActivity = 
          $.getJSON('https://wind-bow.gomix.me/twitch-api/streams/' + streamName + '?callback=?', function(json) {
              var isActive = (json.stream !== null);
              labelActivity.done(function(){
               });
            if (isActive === true) {
              labelSwitch = '<span class="label label-success">Active</span>';$("#streams").append('<div class="well col-xs-4 col-xs-offset-4"><p><img class ="img-responsive img-rounded" style="float: left; margin: 0px 15px 15px 0px;" width="25%" src=' + logo + '><a href=' + url + '>' + name + " " + labelSwitch + '</p></a><p>' + status + '</p></div>');
            }  else {
           labelSwitch = '<span class="label label-default">Inactive</span>';
              $("#streams").append('<div class="well col-xs-4 col-xs-offset-4"><p><img class ="img-responsive img-rounded" style="float: left; margin: 0px 15px 15px 0px;" width="25%" src=' + logo + '><a href=' + url + '>' + name + " " + labelSwitch + '</p></a><p>' + status + '</p></div>');
            }
            
      
    });
  });
});

}
createList();
  
  //View all streams
  $("#all").click(function(){
     $("#onlyLive").removeClass("disabled");
    $("#onlyOffline").removeClass("disabled");
    $("#all").addClass("disabled");
    $("#streams").empty();

createList();
  });
  
  //get rid of non-live streams
  $("#onlyLive").click(function(){
     $("#onlyLive").addClass("disabled");
    $("#onlyOffline").removeClass("disabled");
    $("#all").removeClass("disabled");
    $("#streams").empty();

onlyLiveList();
  });
  
  //get rid of live streams
  $("#onlyOffline").click(function(){
     $("#onlyLive").removeClass("disabled");
    $("#onlyOffline").addClass("disabled");
    $("#all").removeClass("disabled");
    $("#streams").empty();

onlyOfflineList();
  });
  
  //add stream submit function
  $("#addStreamBtn").click(function(){
    streamersList.push($("#addStreamInput").val());
    $("#addStreamInput").val("");
    
     $("#onlyLive").removeClass("disabled");
    $("#onlyOffline").removeClass("disabled");
    $("#all").addClass("disabled");
    $("#streams").empty();

createList();
  });
  
  function onlyOfflineList(){
  streamersList.forEach(function(streamName){
    var call = 'https://wind-bow.gomix.me/twitch-api/channels/' + streamName + '?callback=?';
    
    $.getJSON(call, function(data){
      //create and move the variables to the html
      var url = data.url;
      var name = data.display_name;
      var logo = data.logo;
      var status = data.status;
      var labelSwitch = '';
      var labelActivity = 
          $.getJSON('https://wind-bow.gomix.me/twitch-api/streams/' + streamName + '?callback=?', function(json) {
              var isActive = (json.stream !== null);
              labelActivity.done(function(){
              
            if (isActive === true) {
              labelSwitch = '<span class="label label-success">Active</span>';
            }  else {
           labelSwitch = '<span class="label label-default">Inactive</span>';
              $("#streams").append('<div class="well col-xs-4 col-xs-offset-4"><p><img class ="img-responsive img-rounded" style="float: left; margin: 0px 15px 15px 0px;" width="25%" src=' + logo + '><a href=' + url + '>' + name + " " + labelSwitch + '</p></a><p>' + status + '</p></div>');
            }
            
      });
    });
  });
});

}
//create the live list
function onlyLiveList(){
  streamersList.forEach(function(streamName){
    var call = 'https://wind-bow.gomix.me/twitch-api/channels/' + streamName + '?callback=?';
    
    $.getJSON(call, function(data){
      //create and move the variables to the html
      var url = data.url;
      var name = data.display_name;
      var logo = data.logo;
      var status = data.status;
      var labelSwitch = '';
      var labelActivity = 
          $.getJSON('https://wind-bow.gomix.me/twitch-api/streams/' + streamName + '?callback=?', function(json) {
              var isActive = (json.stream !== null);
              labelActivity.done(function(){
              
            if (isActive === true) {
              labelSwitch = '<span class="label label-success">Active</span>';
              $("#streams").append('<div class="well col-xs-4 col-xs-offset-4"><p><img class ="img-responsive img-rounded" style="float: left; margin: 0px 15px 15px 0px;" width="25%" src=' + logo + '><a href=' + url + '>' + name + " " + labelSwitch + '</p></a><p>' + status + '</p></div>');
            }  else {
           labelSwitch = '<span class="label label-default">Inactive</span>';
              
            }
            
      });
    });
  });
});

}

});


              
            
!
999px

Console