Twitch App
How do I make an twitch app?
What is a twitch app? How do you make a twitch app? This script and codes were developed by Hudson Taylor on 21 January 2023, Saturday.
Twitch App - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Twitch App</title> <!--Import Google Icon Font--> <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> <link rel='stylesheet prefetch' href='https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.6/css/materialize.min.css'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="row"> <div class="col m8 offset-m2 s12 z-depth-1" id="app"> <div class="head"> <h1>Twitch.tv Streamers</h1> </div> <ul class="tabs"> <li class="tab col s3"><a class="active" href="#all">All</a></li> <li class="tab col s3"><a href="#online">Online</a></li> <li class="tab col s3"><a href="#offline">Offline</a></li> </ul> <div id="all" class="col s12 filter"> <ul class="collection"> <li class="collection-item" id="freecodecamp"> <img src="https://static-cdn.jtvnw.net/jtv_user_pictures/freecodecamp-profile_image-d9514f2df0962329-300x300.png" alt="" class="circle"> <a href="https://www.twitch.tv/freecodecamp" target="_blank">FreeCodeCamp</a> <i class="secondary-content material-icons">wifi_tethering</i> </li> <li class="collection-item" id="trymacs"> <img src="https://static-cdn.jtvnw.net/jtv_user_pictures/trymacs-profile_image-3c2ac4643bab750a-300x300.jpeg" alt="" class="circle"> <a href="https://www.twitch.tv/trymacs" target="_blank">Trymacs</a> <i class="secondary-content material-icons">wifi_tethering</i> </li> <li class="collection-item" id="phonecats"> <img src="https://static-cdn.jtvnw.net/jtv_user_pictures/phonecats-profile_image-a536a337b2e58260-300x300.png" alt="" class="circle"> <a href="https://www.twitch.tv/phonecats" target="_blank">phonecats</a> <i class="secondary-content material-icons">wifi_tethering</i> </li> <!--<li>Item <i class="material-icons">portable_wifi_off</i></li> <li>Item <i class="material-icons">wifi_tethering</i></li> <li>Item</li>--> </ul> </div> <div id="online" class="col s12 filter"> <ul class="collection"> <li class="collection-item empty"><span>No streamers currently online</span></li> </ul> </div> <div id="offline" class="col s12 filter"> <ul class="collection"> <li class="collection-item empty"><span>All streamers currently online</span></li> </ul> </div> </div>
</div> <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.8/js/materialize.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Twitch App - Script Codes CSS Codes
body { background-color: pink;
}
#app { margin-top: 50px; padding: 0;
}
.head { background-color: #ee6e73; padding: 15px
}
.head h1 { margin: 0; font-size: 43px; color: #fff; text-shadow: 0.012em 0.012em #ccc;
}
.collection, .collection-item { border: none; border-bottom: none !important;
}
.collection-item img { height: 40px; border: 3px solid #ddd; position: absolute; transition: 0.25s;
}
.filter { background-color: #fff; padding: 0 !important;
}
.filter ul { margin: 0;
}
.filter ul li { border-top: 1px solid #eee; min-height: 60px;
}
.filter ul li:hover img { border-color: #F6B2B5;
}
.filter ul li a { position: relative; top: 10px; margin-left: 50px; color: #ee6e73;
}
.empty span { position: relative; top: 10px;
}
.material-icons { position: relative; top: 9px; font-size: 190%;
}
.offline-icon { color: #e53935;
}
Twitch App - Script Codes JS Codes
$(document).ready(function() { // Declare all variables var users = ["freecodecamp", "trymacs", "phonecats"]; var info = {}; var i; var identifier; for (i = 0; i < users.length; i++) { $.getJSON("https://wind-bow.gomix.me/twitch-api/streams/" + users[i], function(json) { //create key for each object identifier = json["_links"].self; identifier = JSON.stringify(identifier); identifier = identifier.substr(identifier.lastIndexOf('/') + 1); identifier = identifier.slice(0, -1); // Add key/value pair to object info[identifier] = JSON.stringify(json); // Check if user is streaming using length of object if (info.freecodecamp.length < 400) { $('#freecodecamp .material-icons') .addClass('offline-icon') .html('portable_wifi_off'); } if (info.trymacs.length < 400) { $('#trymacs .material-icons') .addClass('offline-icon') .html('portable_wifi_off'); } if (info.phonecats.length < 400) { $('#phonecats .material-icons') .addClass('offline-icon') .html('portable_wifi_off'); } // Filter content into online section $('#all ul li').each(function() { if ($(this).children('.material-icons').hasClass('offline-icon') === false) { $('#online ul li.empty').css('display', 'none'); $('#online ul').append($(this).clone()); } else { $('#offline ul li.empty').css('display', 'none'); $('#offline ul').append($(this).clone()); } }); }); } /*$.getJSON("", function(json) { // Only change code below this line. json = json.filter(function(val) { return (val.id !== 1); }); // Only change code above this line. json.forEach(function(val) { }); }); // Thanks to Tyler Moeller for his help with this function /*users.map(function(val) { var url = 'https://wind-bow.gomix.me/twitch-api/streams/' + val $.getJSON(url, logTheData); }); function logTheData(data) { status.push(data); } console.log(status)
});*/
});
Developer | Hudson Taylor |
Username | Hudson_Taylor11 |
Uploaded | January 21, 2023 |
Rating | 3 |
Size | 3,354 Kb |
Views | 4,048 |
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!
Name | Size |
Weather App | 2,905 Kb |
A Pen by Hudson Taylor | 2,425 Kb |
Cool Modal Idea | 3,296 Kb |
Pixelated Retro Bowser | 3,080 Kb |
Wikipedia Viewer | 3,596 Kb |
Preloading Screen | 2,026 Kb |
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!
Name | Username | Size |
Sticky footer testing | 75th | 1,649 Kb |
Vue Transition | Chenming142 | 4,561 Kb |
Animate elements with fixed gradient | Badabam | 4,406 Kb |
Lightning | Akm2 | 19,150 Kb |
Geildanke typography | Fischaela | 3,249 Kb |
HTML5 Video Autoplay | Zivcos | 1,352 Kb |
Horizontal Navigation with Floats | Gymratpacks | 5,403 Kb |
Loading animation with css | Icebob | 2,947 Kb |
Scroll to view if element partially out of view port height | ChrisMaki | 2,104 Kb |
Savemedia1.1 | EdsonAlcala | 2,148 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!