FreeCodeCamp - Twitchtv API

Developer
Size
2,531 Kb
Views
16,192

How do I make an freecodecamp - twitchtv api?

What is a freecodecamp - twitchtv api? How do you make a freecodecamp - twitchtv api? This script and codes were developed by Jason Thomas on 14 September 2022, Wednesday.

FreeCodeCamp - Twitchtv API Previews

FreeCodeCamp - Twitchtv API - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>freeCodeCamp - Twitchtv API</title> <link rel='stylesheet prefetch' href='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.6/css/bootstrap.min.css'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="container"> <button id="all_btn">All</button> <button id="online_btn">Online</button> <button id="offline_btn">Offline</button>
<div class="list-group" id ="listAll"> <!--list appended here--> </div> <div id="online"> <div class="list-group" id="listOnline"> <!--list appended here--> </div> </div> <div id="offline"> <div class="list-group" id="listOffline"> <!--list appended here--> </div> </div>
</div> <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.6/js/bootstrap.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

FreeCodeCamp - Twitchtv API - Script Codes CSS Codes

.container { width:700px;
}
body { background-image:url(https://dl.dropboxusercontent.com/s/u7qiz4qrmxa3slf/cubes.png?dl=0)
}
.badge { margin-top: 10px;
}
.badge { background-color: #6441A5;
}

FreeCodeCamp - Twitchtv API - Script Codes JS Codes

$(document).ready(function() { $("#all_btn").click(function(){ $("#listAll").show(); $("#online").show(); $("#offline").show();
});
$("#online_btn").click(function(){ $("#listAll").show(); $("#online").show(); $("#offline").hide();
});
$("#offline_btn").click(function(){ $("#listAll").hide(); $("#online").hide(); $("#offline").show();
});
var users = ["ESL_SC2", "OgamingSC2", "cretetion", "freecodecamp", "storbeck", "habathcx", "RobotCaleb", "noobs2ninjas"];
users.forEach(function(streamer) { $.getJSON('https://wind-bow.gomix.me/twitch-api/streams/' + streamer + '?callback=?', function(data) { console.log(data); var HTML = ""; if (data.stream === null) { //ofline HTML += '<a href= "https://www.twitch.tv/'+streamer +'" class="list-group-item" target = "_blank"><h4><span class="label label-danger">Offline</span></h4>' +"<b> "+ streamer +'</b></a>'; $("#listOffline").append(HTML); //$("#listAll").append(HTML); } else if (data.stream == undefined) { //account closed HTML += '<a href= "https://www.twitch.tv/" target= "_blank" class="list-group-item"><span class="label label-default">Account Closed</span>' +" "+ streamer + '</a>'; //$("#listAll").append(HTML); } else { //online HTML += '<a href= "'+data.stream.channel.url+'" class="list-group-item" target = "_blank"><img src="' + data.stream.channel.logo + '"></img><h4><span class="label label-primary">Online</span></h4>' + "<b> "+streamer+'</b><span> - Playing '+data.stream.game+'</span><span class="badge">'+data.stream.viewers+' viewers</span></br><span id="title">'+data.stream.channel.status+'</span></a>'; //$("#listOnline").prepend(HTML); $("#listAll").prepend(HTML); } }); });
})
FreeCodeCamp - Twitchtv API - Script Codes
FreeCodeCamp - Twitchtv API - Script Codes
Home Page Home
Developer Jason Thomas
Username samoht513
Uploaded September 14, 2022
Rating 3
Size 2,531 Kb
Views 16,192
Do you need developer help for FreeCodeCamp - Twitchtv API?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Jason Thomas (samoht513) Script Codes
Create amazing Facebook ads with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!