Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

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

              
                <html>

<head>

<link href="https://fonts.googleapis.com/css?family=Ultra" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Permanent+Marker" rel="stylesheet">

<meta charset="utf-8">
<title>Twitchtv JSON API</title>

</head>

<body>

<div class="container">

<div id="titleDiv" class="text-center fontFCC">
<h1 style="color:gold">Hello I'm A TwitchTV Project</h1><br>
<a href="https://www.twitch.tv/freecodecamp" target="_blank">
<h3 id="fccON"></h3>
</a>
</div>

</div>

<div id="ourList"></div>

</body>

</html>
              
            
!

CSS

              
                body{
  background-image: url("http://www.hd-freewallpapers.com/latest-wallpapers/desktop-abstract-3d-wallpaper-download.jpg");
  background-size: cover;
  color: orange;
}

div{
  padding: .5%;
}

.row{
  background: rgba(0,0,0,.5);
  border: .25em silver solid;
  border-radius: 2em;
  margin: .5%;
}

#titleDiv{
  background: rgba(0,0,0,.5);
  border: .5em purple double;
  border-radius: 2em;
  margin-top: 5%;
}

#handwriting{
  font-family: 'Permanent Marker', cursive;
  font-size: 1.5em;
}

.fontFCC{
  font-family: 'Ultra', serif;
}
              
            
!

JS

              
                //streamTwitch          https://api.twitch.tv/kraken/streams/          /?client_id=0wyv5my3mmge7z55ebkh0ggttjq9bt
//channelsTwitch          https://api.twitch.tv/kraken/channels/          /?client_id=0wyv5my3mmge7z55ebkh0ggttjq9bt

$(document).ready(function(){
  
  var array=["kurtiskush", "disguisedtoasths", "back2warcraft", "shroud", "ogamingsc2", "blizzheroes"];
  var urlForCamp="https://api.twitch.tv/kraken/streams/freecodecamp/?client_id=0wyv5my3mmge7z55ebkh0ggttjq9bt";
  
  
  //freeCodeCamp div
  $.getJSON(urlForCamp, function(streamsTwitch){
    if(streamsTwitch.stream===null){
      $("#fccON").html("<p style='color:red'> Free Code Camp Is Offline :(</p>");
    }
    else{
      $("#fccON").html("<p style='color:green'> Free Code Camp Is Online :)</p>");
    }
  });
  
  
    //determining offline status
    for (var i=0; i<array.length; i++){
      
      var urlForOthersOffline="https://api.twitch.tv/kraken/streams/"+array[i]+"/?client_id=0wyv5my3mmge7z55ebkh0ggttjq9bt";
      
      $.getJSON(urlForOthersOffline).done(function(streamTwitchOffline){
        if(streamTwitchOffline.stream==null){
          $.getJSON(streamTwitchOffline._links.channel+"/?client_id=0wyv5my3mmge7z55ebkh0ggttjq9bt", function(channelsTwitch){
            var logo=channelsTwitch.logo;
            var name=streamTwitchOffline._links.self.slice(37);
            var status="OFFLINE";
            var banner=channelsTwitch.profile_banner;
            var banner2=channelsTwitch.video_banner;
            //if there's no logo
            if(logo===null){
              logo="https://cdn3.iconfinder.com/data/icons/abstract-1/512/no_image-512.png";
            }
            
            $("#ourList").prepend("<div class='row'>" + "<div class='col-lg-2'>" + "<img style='width:75%; border-radius:50%' src='" + logo + "'>" + "</div>" + "<div class='col-lg-3'>" + "<a style='color:red; font-size:2.5em; font-weight:bold' target='_blank' href='https://www.twitch.tv/" + name + "'>" + name + "</a><br>" + "<div style='font-size:1.5em; color:red'>Offline... but will be back soon :)</div>" + "</div>" + "<div class='col-lg-4'>" + "<img class='img-thumbnail' style='width:100%; height:100%' src='" + banner + "'>" + "</div>" + "<div class='col-lg-3'><img class='img-thumbnail' style='width:100%; height:100%' src='" + banner2 + "'></div>" + "</div>");
          });
        }
      });
    }
    
    
    //determining online status
    for(var i=0; i<array.length; i++){
      
      var urlForOthersOnline="https://api.twitch.tv/kraken/streams/"+array[i]+"/?client_id=0wyv5my3mmge7z55ebkh0ggttjq9bt";
      
      $.getJSON(urlForOthersOnline, function(streamTwitch){
        var logo=streamTwitch.stream.channel.logo;
        //if there's no logo
        if(logo===null){
          logo="https://cdn3.iconfinder.com/data/icons/abstract-1/512/no_image-512.png";
        }
        
        var name=streamTwitch.stream.channel.display_name;
        var game=streamTwitch.stream.channel.game;
        var status=streamTwitch.stream.channel.status;
        var preview=streamTwitch.stream.preview.large;
        $("#ourList").prepend("<div class='row'>" + "<div class='col-lg-2'>" + "<img style='width:80%; border-radius:50%' src='" + logo + "'>" + "</div>" + "<div class='col-lg-4'>" + "<a style='color:green; font-size:3em; font-weight:bold' target='_blank' href='https://www.twitch.tv/" + name + "'>" + name + "</a><br>" + "<div style='font-size:1.5em; color:silver'>Playing: " + game + "</div>" + "</div>" + "<div id='handwriting' class='col-lg-3'><br>" + status + "</div>" + "<div class='col-lg-3'><img class='img-thumbnail' style='width:100%; height:100%' src='" + preview + "'></div>" + "</div>");
      });
    }
  
});
              
            
!
999px

Console