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

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

              
                <html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Twitch Project</title>
  <link rel="stylesheet" href="assets/font-awesome-icons/css/font-awesome.min.css">
  <link rel="stylesheet" type="text/css" href="assets/stylesheets/main.css">
  <link href='https://fonts.googleapis.com/css?family=Catamaran:300,500,700' rel='stylesheet' type='text/css'>
</head>
<body>
  <main>
    <header>
    <div class="title">
      <p>Twitch Streamers</p>
    </div>
    <div class="containOptions">
      <div class="displayOption" id="all">
        <div class="circle allColor">
        </div>
        <p>All<p>
      </div>
      <div class="displayOption" id="online">
        <div class="circle onlineColor"></div>
        <p>Online<p>
      </div>
      <div class="displayOption" id="offline">
        <div class="circle offlineColor"></div>
        <p>Offline<p
      </div>
    </div>
    </header>
    <nav>
      <div>
        <i class="fa fa-search" aria-hidden="true"></i>
      </div>
      <div>
        <input type="text" name="search" placeholder="Search by Username">
      </div>
    </nav>
    <section class="users">
    </section>
  </main>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
  <script src="main.js" type="text/javascript"></script>
</body>
</html>
              
            
!

CSS

              
                /* CSS Reset */
/* https://meyerweb.com/eric/tools/css/reset/ 
   v2.0 | 20110126
   License: none (public domain)
*/

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section {
  display: block;
}
body {
  line-height: 1;
}
ol, ul {
  list-style: none;
}
blockquote, q {
  quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
  content: '';
  content: none;
}
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* Box-Sizing Fix */
/* apply a natural box layout model to all elements, but allowing components to change */
html {
  box-sizing: border-box;
}
*, *:before, *:after {
  box-sizing: inherit;
}

/*font-size default*/


/*************
Layout
*************/
body {
  /*background: url("file:///Users/mg/js_exercises/websites/free_code_camp/twitch/assets/images/background.jpg") no-repeat center center fixed;*/
  /*background: url("http://www.intrawallpaper.com/static/images/light_textured_backround_GnbGFCY.jpg") no-repeat center center fixed;*/
  background: url("https://res.cloudinary.com/dyr8j9g6m/image/upload/v1469508793/background_gx5wbz.jpg") no-repeat center center fixed;
  background-size: cover;
  font-size: 62.5%;
  font-family: 'Catamaran', helvetica, arial, sans-serif;
}

main {
  margin: 0 auto;
  background: #c0c0c0;
  width: 100%;
}

@media screen and (min-width: 600px) {
  main {
    width: 600px;
  }
}

/****************
Module
****************/

header {
  background: rgb(0,0,0);
  color: rgb(255,255,255);
  text-transform: uppercase;
  height: 80px;
  position: relative;
}

@media screen and (min-width: 600px) {
  header {
    margin-top: 1.5625%;
    overflow: hidden; /*to hide rest of all, online offline*/
  }
}

.title {
  position: absolute;
  top: 30px;
  left: 7px;
}

.title p {
  display: inline-block;
  font-weight: bold;
  font-size: 2.4em; /*24px*/
  margin-top: -150px;
}

header div {
  display: inline-block;
}

header div p {
  font-weight: 300;
  font-size: 1.2em;
  text-align: right;
  display: inline-block;
  margin-left: 3px;
}

.containOptions {
  position: relative;
}

.displayOption {
  display: block;
  margin-top: 5px;
  position: relative;
  left: 585px; /*was at 530*/
  background: rgb(225, 225, 230);
  padding: 2px;
}

.displayOption p {
  color: #dc143c;
}

.displayOption:first-child {
  margin-top: 10px;
}
.circle {
  background: transparent;
  border-radius: 100%;
  width: 10px;
  height: 10px;
  display: inline-block;
}

.allColor {
  border: 5px solid #ffa500;
}

.onlineColor {
  border: 5px solid #0ff;
}

.offlineColor {
  border: 5px solid #ff00ff;
}

nav {
  width: 600px; /* don't think this needs to be recalculated */
  background: #eee;
  margin: 0 auto;
  padding: 10px;
  margin-top: 5px;
  position: relative;
}

nav div:first-child {
  margin-right: 5px;
}

nav div {
  display: inline-block;
}

.fa-search {
  font-size: 2em;
}

nav p {
  display: inline-block;
  margin-left: 5px;
  font-size: 1.6em;
  color: #666;
}

input {
  outline: none;
  border: none;
  font-size: 1.6em;
  background: #eee;
  width: 550px;
}

/*****************
Users
*****************/

.users {
  width: 572px;
  margin: 0 auto;
}

.users img {
  border-radius: 100%;
  width: 45px;
  height: 45px;
  float: left;
}

.online,
.offline,
.unavailable {
  height: 79px;
  padding: 10px; 
}

.username,
.userinfo {
  color: white;
  margin-left: 60px;
}

.username {
  font-weight: 500;
  font-size: 1.8em;
  text-decoration: none;
  display: block;
}

.userinfo {
  font-weight: 300;
  font-size: 1.6em;
  display: block;
  text-decoration: none;
}

.online {
  background: #0ff;
}

.offline {
  background: #ff00ff
}

.unavailable {
  background: #444;
}

/*************
State
*************/
::-webkit-input-placeholder {
  color: #222;
}

::-moz-placeholder { /* Firefox 19+ */
  color: #222;
}
:-ms-input-placeholder { /* IE 10+ */
  color: #222;
}
:-moz-placeholder { /* Firefox 18- */
  color: #222;
}

.displayOption :hover {
  cursor: pointer;
}
              
            
!

JS

              
                /*
function getStreamerData (url) {
  return $.getJSON(url, function(data) {
    return data;
  // console.log(data._links.channel);
  // console.log(data.stream.channel.logo);
  });
}
*/

// getStreamerData('https://api.twitch.tv/kraken/streams/freecodecamp?callback=?');
// getStreamerData('https://api.twitch.tv/kraken/streams/esl_sc2?callback=?');
// getStreamerData('https://api.twitch.tv/kraken/streams/brunofin?callback=?');
// getStreamerData('https://api.twitch.tv/kraken/channels/freecodecamp');

/*So what I need to do is*/
//1. create all function (DONE! maybe refactor)
//2. create online function (DONE! maybe refactor)
//3. create offline function (DONE! maybe refactor)
//4. create event handlers for clicking the all, online and offline buttons (DONE! maybe refactor)
//5. create search function (optional)
//6. fix modify the appearance and cursor for the all, online and offline buttons
  //1. have it slideout like in the FCC example
  //2. set the pointer to a cursor when hovering over the buttons (DONE)
  //3. disable the button when it is the current state (DONE)


/*searchThroughUsers function
//1. create an array of all the users I want 
//2. iterate over the array
//3. call the getStreamerData function on a string of "https://api.twitch.tv/kraken/streams/" + users.toLowercase() + ?callback=?
//4. if data.stream equals undefined (closed account)
  /* separate this into a function? */
  //0. call the addDiv function w/ the argument acctClosed
//5.else if data.stream equals null
  //0. var url equals data._links.channel
  //1. call the addDiv function w/ the argument offline and url
//6. else 
  //1. var logoUrl equals data.stream.channel.logo
  //1.5 var game equals data.stream.channel.game
  //1.75 var streamInfo = data.stream.channel.status
  //2. call the addDiv function w/ the argument online, logoUrl, game, streamInfo

/*
function justGetUsers() {
  var users = ["storbeck", "ESL_SC2", "Habathcx", "FreeCodeCamp", "RobotCaleb", "cretetion", "noobs2ninjas", "comster404", "OGamingSC2", "sheevergaming", "Beohoff", "TR7K", "brunofin", "Test_channel"];
  return users;
}*/

function clearAndGetUsers(click) {
  $(".users").empty();
  var users = ["storbeck", "ESL_SC2", "Habathcx", "FreeCodeCamp", "RobotCaleb", "cretetion", "noobs2ninjas", "comster404", "OGamingSC2", "sheevergaming", "Beohoff", "TR7K", "brunofin", "Test_channel"]
  if (click === "click") {
    $("[name=search]").val("");
  }
  return users;
}

function all(click) {
  // console.log(click);
  var users = clearAndGetUsers(click);
  // console.log("clicked on all")
  // console.log(event);
  // console.log(event.target)
  $("#all").css({
    "pointer-events": "none",
    "background-color": "yellow"
  }).css("background-color", "yellow");
  $("#online").css({
    "pointer-events": "auto",
    "background-color": "rgb(225, 225, 230)"
  });
  $("#offline").css({
    "pointer-events": "auto",
    "background-color": "rgb(225, 225, 230)"
  });
  $("[name=search]").attr("placeholder", "Search All Users By Username");
  // $("#all").attr("disabled", true);
  // $("#online").removeAttr("disabled");
  // $("#offline").removeAttr("disabled");
  for (var i = 0; i < users.length; i++) {
    var searchThisUrl = "https://api.twitch.tv/kraken/streams/" + users[i].toLowerCase() + "?callback=?"; //I actually needed to add this semicolon
    // console.log(users[i]);
    (function IIFE(i){
    $.getJSON(searchThisUrl, function(data) {
      if (data.stream === undefined) {
        // console.log("Account closed");
        // console.log(users[i]);
        // console.log(users);
        addUnavailableDiv(users[i]);
      } else if (data.stream === null) {
        // console.log("Offline");
        // console.log("hits this if");
        // console.log("this is the url I want", data._links.channel);
        addOfflineDiv(users[i], data._links.channel)
      } else {
        // console.log("streaming");
        // console.log("This is the image: ", data.stream.channel.logo);
        // console.log("This is the game: ", data.stream.channel.game)
        // console.log("This is the stream info: ", data.stream.channel.status)
        addOnlineDiv(users[i], data.stream.channel.logo, data.stream.channel.game, data.stream.channel.status)
      }
    })
  })(i)
  }
 }

 function online(click){
  var users = clearAndGetUsers(click);
  $("#all").css({
    "pointer-events": "auto",
    "background-color": "rgb(225, 225, 230)"
})
  $("#online").css({
    "pointer-events": "none",
    "background-color": "yellow"
});
  $("#offline").css({
    "pointer-events": "auto",
    "background-color": "rgb(225, 225, 230)"
  });
  $("[name=search]").attr("placeholder", "Search Online Users By Username");
  for (var i = 0; i < users.length; i++) {
    var searchThisUrl = "https://api.twitch.tv/kraken/streams/" + users[i].toLowerCase() + "?callback=?"; //I actually needed to add this semicolon
    (function IIFE(i){
    $.getJSON(searchThisUrl, function(data) {
      if (data.stream) {
        // console.log("Offline");
        // console.log("hits this if");
        // console.log("this is the url I want", data._links.channel);
        addOnlineDiv(users[i], data.stream.channel.logo, data.stream.channel.game, data.stream.channel.status)
      }
    })
  })(i)
 }
}

function offline(click){
  var users = clearAndGetUsers(click);
  $("#all").css({
    "pointer-events": "auto",
    "background-color": "rgb(225, 225, 230)"
  });
  $("#online").css({
    "pointer-events": "auto",
    "background-color": "rgb(225, 225, 230)"
  });
  $("#offline").css({
    "pointer-events": "none",
    "background-color": "yellow"
});
  $("[name=search]").attr("placeholder", "Search Offline Users By Username");
  for (var i = 0; i < users.length; i++) {
    var searchThisUrl = "https://api.twitch.tv/kraken/streams/" + users[i].toLowerCase() + "?callback=?"; //I actually needed to add this semicolon
    (function IIFE(i){
    $.getJSON(searchThisUrl, function(data) {
      if (data.stream === null) {
        // console.log("Offline");
        // console.log("hits this if");
        // console.log("this is the url I want", data._links.channel);
        addOfflineDiv(users[i], data._links.channel)
      }
      if (data.stream === undefined) {
        // console.log("Account closed");
        // console.log(users[i]);
        // console.log(users);
        addUnavailableDiv(users[i]);
      } 
    })
  })(i)
}
}

function search(){
  // console.log("the search function executes");
  if ($("[name=search]").attr("placeholder") === "Search All Users By Username") {
    // console.log("It hits all users!");
    searchAll();
  } else if ($("[name=search]").attr("placeholder") === "Search Online Users By Username"){
      // console.log("It hits online users!")
      searchOnline();
  } else {
    // console.log("It hits offline users!");
    searchOffline();
  }
}

//0. clear and get the users
//1. iterate over the array of users 
  //2. if the input text equals a slice of the current user from 0 to the input text length
    //1. use the same logic as the all function to add a div
function searchAll(){
  // console.log("in search all function")
  // all("not a click");
  // console.log("all has run");
  var users = clearAndGetUsers();
  // console.log(searchInput["0"].value);
  for (var i = 0; i < users.length; i++) {
    var searchThisUrl = "https://api.twitch.tv/kraken/streams/" + users[i].toLowerCase() + "?callback=?"; //I actually needed to add this semicolon
    // console.log(users[i]);
    (function IIFE(i){
    $.getJSON(searchThisUrl, function(data) {
      var searchInput = $("[name=search]")
      var searchText = searchInput["0"].value
      // console.log(searchInput["0"].value);
      if (searchText === users[i].slice(0,searchText.length)){
        if (data.stream === undefined) {
        // console.log("Account closed");
        // console.log(users[i]);
        // console.log(users);
        addUnavailableDiv(users[i]);
      } else if (data.stream === null) {
        // console.log("Offline");
        // console.log("hits this if");
        // console.log("this is the url I want", data._links.channel);
        addOfflineDiv(users[i], data._links.channel)
      } else {
        // console.log("streaming");
        // console.log("This is the image: ", data.stream.channel.logo);
        // console.log("This is the game: ", data.stream.channel.game)
        // console.log("This is the stream info: ", data.stream.channel.status)
        addOnlineDiv(users[i], data.stream.channel.logo, data.stream.channel.game, data.stream.channel.status)
      }
      }
    })
  })(i)
  }
 }

 //1. get users via clearAndGetUsers
 //2. iterate over the users
 //3. make an api call for each user
 //4. if the value of the searchText equals the value of the user (sliced from 0 to searchText length)
 //5. if the value of the stream is truthy
 //6. call addOnlineDiv function
 function searchOnline(){
  var users = clearAndGetUsers();
  for (var i = 0; i < users.length; i++) {
    var searchThisUrl = "https://api.twitch.tv/kraken/streams/" + users[i].toLowerCase() + "?callback=?"; //I actually needed to add this semicolon
    (function IIFE(i){
    $.getJSON(searchThisUrl, function(data) {
      var searchInput = $("[name=search]");
      var searchText = searchInput["0"].value;
      if (searchText === users[i].slice(0,searchText.length)) {
        if (data.stream) {
          // console.log("Offline");
          // console.log("hits this if");
          // console.log("this is the url I want", data._links.channel);
          addOnlineDiv(users[i], data.stream.channel.logo, data.stream.channel.game, data.stream.channel.status)
      }
    }
    })
  })(i)
 }
}

//1. get users via clearAndGetUsers
//2. iterate over the users
//2.5 make call to api for each user
//3. if the input search equals the value of the user (slice from 0 to the length)
  //1. call the make offline dive function
function searchOffline(){
  var users = clearAndGetUsers();
  for (var i = 0; i < users.length; i++) {
      var searchThisUrl = "https://api.twitch.tv/kraken/streams/" + users[i].toLowerCase() + "?callback=?"; //I actually needed to add this semicolon
      (function IIFE(i){
      $.getJSON(searchThisUrl, function(data) {
        var searchInput = $("[name=search]")
        var searchText = searchInput["0"].value;
        // console.log(searchText);
        if (searchText === users[i].slice(0,searchText.length)) {
          if (data.stream === null) {
          // console.log("Offline");
          // console.log("hits this if");
          // console.log("this is the url I want", data._links.channel);
          addOfflineDiv(users[i], data._links.channel)
          }
          if (data.stream === undefined) {
        // console.log("Account closed");
        // console.log(users[i]);
        // console.log(users);
        addUnavailableDiv(users[i]);
          } 
        }
      })
    })(i)
  }
}

/*var moveLeft = function(move) {
  console.log("hits this");
    do {
      $("#online").animate({
      left: "-=55px"
      }, 1000)
    } while (move === true);
    }*/

all("initialized");
 $("#all").on("click", function(){
  all("click");
 });
 $("#online").on("click", function(){
  online("click");
 });
 $("#offline").on("click", function(){
  offline("click");
 });
 $("[name=search]").on("keypress",search);
 $("[name=search]").on("keyup",function(e){
    if (e.keyCode == 8){
      // console.log("delete key pressed");
      search();
    }
 });
 $(".displayOption").on("mouseenter", function(){
  $(this).animate({
    left: "530px"
  }).on("mouseleave", function(){
    $(this).animate({
      left: "585px"
    })
  })
 })

 /*
  $(".displayOption").on("mouseleave", function(){
  $(this).animate({
    right: "-55px"
  })
 })*/
 /*
 $("#online").on("mouseover", function(){ 
  var canMove = false;
    moveLeft(canMove);
 })*/
//END: call all function when page loads

/*function addUnavailableDiv*/
//0. create newDiv
//1. add the class unavailable to the newDiv
//1.5 create a blank profile image add the src of the image via attr add the selector .users img append it to the the newDiv
//1.6 create a paragraph, add the class username, add text (which will be the current username) append it to the newDiv
//2. create a paragraph, add the class userinfo, add text (which will be Account Closed) append it to the newDiv
//5. append the new div to the end of the .users section

function addUnavailableDiv(username) {
  // console.log(username);
  var twitchProfile = "https://www.twitch.tv/" + username.toLowerCase();
  var newDiv = $("<div>").addClass("unavailable")
  $("<img>").attr({
    /*src: "assets/images/nophoto_user.png",*/
    src: "https://res.cloudinary.com/dyr8j9g6m/image/upload/v1469596595/nophoto_user_cvntek.png",
    alt: "unavailable"
  }).appendTo(newDiv);
  $("<a>").addClass("username").attr("href", twitchProfile).text(username).appendTo(newDiv);
  $("<a>").addClass("userinfo").attr("href", twitchProfile).text("Account Closed").appendTo(newDiv);
  // $("<p>").addClass("username").text(username).appendTo(newDiv);
  // $("<p>").addClass("username").html(<a href=""username).appendTo(newDiv);
  // $("<p>").addClass("userinfo").text("Account Closed").appendTo(newDiv);
  newDiv.appendTo(".users");
}

/*function addOfflineDiv(username, offlineUrl)
//0. create newDiv
//1. add the class offline to the newDiv
//1.5 set channelData to a call to getStreamerData w/ the offlineUrl 
//1.75 set logo to a call to channelData.logo
//2. create an img add a src attr of logo and append it to the newDiv 
//2.1 create a paragraph, add the class username, add text (which will be the current username) append it to the newDiv
//3. create a paragraph, add the class userinfo, add text (which will be Offline) append it to the newDiv
//5. append the new div to the body*/

function addOfflineDiv(username, offlineUrl) {
  // console.log(username, offlineUrl);
  var twitchProfile = "https://www.twitch.tv/" + username.toLowerCase();
  var newDiv = $("<div>").addClass("offline");
  $.getJSON(offlineUrl, function(data){
    var logo = data.logo;
    // console.log(logo);
    if (logo === null) {
      $("<img>").attr({
    /*src: "assets/images/nophoto_user.png",*/
    src: "https://res.cloudinary.com/dyr8j9g6m/image/upload/v1469596595/nophoto_user_cvntek.png",
    alt: "unavailable"
  }).appendTo(newDiv);
    // var linkToUser = "https://www.twitch.tv/" + username.toLowerCase();
    // console.log(linkToUser)
    $("<a>").addClass("username").attr("href", twitchProfile).text(username).appendTo(newDiv);
    $("<a>").addClass("userinfo").attr("href", twitchProfile).text("Offline").appendTo(newDiv);
    // var usernamePar = $("<p>").addClass("username").text(username).appendTo(newDiv);
    // $("<a>").text(username).attr("src", linkToUser).appendTo(usernamePar);
    // $("<p>").addClass("userinfo").text("Offline").appendTo(newDiv);
    newDiv.appendTo(".users");
    } else {
      $("<img>").attr({
        src: logo,
        alt: "profile-pic"
      }).appendTo(newDiv);
    $("<a>").addClass("username").attr("href", twitchProfile).text(username).appendTo(newDiv);
    $("<a>").addClass("userinfo").attr("href", twitchProfile).text("Offline").appendTo(newDiv);
    // $("<p>").addClass("username").text(username).appendTo(newDiv);
    // $("<p>").addClass("userinfo").text("Offline").appendTo(newDiv);
    newDiv.appendTo(".users");
    }
  })

}

/* function add OnlineDiv(username, logoUrl, game, streamInfo)
//0. create newDiv
//1. add the class online to the newDiv
//2. create an img add a src attr of logoUrl and append it to the newDiv
//3. create a paragraph, add the class username, add text (which will be the current username) append it  to the newDiv
//4. create a paragraph, add the class userinfo, add text (which will be game + : + streamInfo) append it to the newDiv
//5. append the newDiv to the body*/

function addOnlineDiv(username, logoURL, game, streamInfo) {
  // console.log(username, logoURL, game, streamInfo);
  var twitchProfile = "https://www.twitch.tv/" + username.toLowerCase();
  // console.log(twitchProfile);
  var newDiv = $("<div>").addClass("online");
  $("<img>").attr({
    src: logoURL,
    alt: "profile-pic"
  }).appendTo(newDiv);
  // console.log("hit this in addOnlineDiv");
  $("<a>").addClass("username").attr("href", twitchProfile).text(username).appendTo(newDiv);
  // $("<p>").addClass("username").text(username).appendTo(newDiv);
  $("<a>").addClass("userinfo").attr("href", twitchProfile).text(game + ": " + streamInfo).appendTo(newDiv);
  newDiv.appendTo(".users");
}

/* sample divs originally in index.html representing a sample online user, offline user, and user w/ a closed account (given the class unavailable)
      <div class="online">
        <img src="https://res.cloudinary.com/dyr8j9g6m/image/upload/v1469217425/logo-placeholder_uuxw8l.png" alt="sample-logo">
        <!--<img src="assets/images/logo-placeholder.png" alt="sample-logo"> -->
        <p class="username">OnlineUser</p>
        <p class="userinfo">Blablabla. I'm streaming stuff.</p>
      </div>
      <div class="offline">
        <img src="https://res.cloudinary.com/dyr8j9g6m/image/upload/v1469217425/logo-placeholder_uuxw8l.png" alt="sample-logo">
        <!-- <img src="assets/images/logo-placeholder.png" alt="sample-logo"> -->
        <p class="username">OfflineUser</p>
        <p class="userinfo">Blablabla. I'm not streaming stuff.</p>
      </div>
      <div class="unavailable">
        <img src="https://res.cloudinary.com/dyr8j9g6m/image/upload/v1469217425/logo-placeholder_uuxw8l.png" alt="sample-logo">
        <!-- <img src="assets/images/logo-placeholder.png" alt="sample-logo"> -->
        <p class="username">UnavailableUser</p>
        <p class="userinfo">Blablabla. I'm never streaming stuff.</p>
      </div>
*/

/* attempt to get the api via vanillaJS
var getData = function(url) {

  var request = new XMLHttpRequest();
  request.open('GET', url, true);
  // request.send();
  request.send();
  console.log("this is the data", request.response);
  console.log("working here");
}
getData('https://api.twitch.tv/kraken/streams/esl_sc2');
*/


/*function httpGet(url) {
  var xhr = new XMLHttpRequest();
  xhr.open("GET", url);
  xhr.send();
  console.log(xhr);
}

httpGet('https://api.twitch.tv/kraken/streams/esl_sc2');
*/
              
            
!
999px

Console