Twitch.tv API Query
How do I make an twitch.tv api query?
What is a twitch.tv api query? How do you make a twitch.tv api query? This script and codes were developed by Paulo Sérgio on 19 November 2022, Saturday.
Twitch.tv API Query - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Twitch.tv API Query</title> <link rel='stylesheet prefetch' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css'> <link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="container" ng-app="myApp"> <div class="jumbotron text-center"> <h1>Twitch.tv Api Query</h1> <input class="form-control" ng-model="search" type="text" placeholder="Type here"> </div> <div class="row" ng-controller="TwitchController"> <div class="col-md-12" ng-repeat="user in userlist | filter:search"> <div class="panel panel-default" ng-class="user.class"> <div class="panel-heading">{{user.name}}</div> <div class="panel-body"> <div class="media"> <a class="media-left" href="#"> <img class="media-object" ng-src="{{user.logo}}" alt="{{user.name}}"> </a> <div class="media-body"> <div class="row"> <div class="col-md-6"> <h4 ng-if="user.status" class="media-heading"><b>Broadcasting: {{user.status}}</b></h4> <blockquote> <a target="_blank" ng-href="{{user.url}}">{{user.name}}</a> <footer ng-if="user.status">{{user.name}}</footer> </blockquote> </div> <div class="col-md-6"> <div class="pull-right"> <div class="label" ng-class="getStatus(user.status)"> <i class="glyphicon glyphicon-info-sign"></i> </div> {{getText(user.status)}} </div> </div> </div> </div> <!-- end of body --> </div> </div> <!-- end panel body --> </div> </div> </div>
</div> <script src='https://code.jquery.com/jquery-2.2.4.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.5/angular.min.js'></script>
<script src='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Twitch.tv API Query - Script Codes CSS Codes
.scale { -webkit-transition-duration: 1s; /* Safari */ transition-duration: 1s; -ms-transform: scale(1.2, 1.2); /* IE 9 */ -webkit-transform: scale(1.2, 1.2); /* Safari */ transform: scale(1.2, 1.2);
}
.without-scale { -webkit-transition-duration: 1s; /* Safari */ transition-duration: 1s; -ms-transform: scale(1, 1); /* IE 9 */ -webkit-transform: scale(1, 1); /* Safari */ transform: scale(1, 1);
}
.media-object { width: 64px; height: 64px;
}
.panel-primary { opacity: 0.2;
}
.fullopactity { opacity: 1 !important;
}
Twitch.tv API Query - Script Codes JS Codes
var app = angular.module('myApp' , []);
app.controller('TwitchController' , [ '$scope' , '$timeout' , function($scope , $timeout){ $scope.userlist = []; $scope.getStatus = function(status){ return status ? ("label-success") : ("label-danger"); } $scope.getText = function(status){ return status ? ("Online") : ("Offline"); } $scope.$watch('search' , function(){ console.log("has changed"); $.each($scope.userlist , function(){ var data = this; $("." + data.class).animate({ opacity: 1} , 1000); $("." + data.class).on('mouseover', function(){ $(this).addClass('scale'); $(this).removeClass('without-scale'); }); $("." + data.class).on('mouseout', function(){ $(this).removeClass('scale'); $(this).addClass('without-scale'); }); }) }); //$scope.search = ""; //sync request $scope.index = 0; $.getJSON('https://api.twitch.tv/kraken/channels/freecodecamp/follows?direction=DESC&limit=105', function(data) { console.log(data); //if channel is null, user is offline $.each(data.follows , function(){ //console.log(this); var user = this.user; //get follow var name = user.name; //your name //add new user to list $.getJSON('https://api.twitch.tv/kraken/channels/' + name ,function(data){ console.log(data); if(!data.logo) data.logo = "https://static-cdn.jtvnw.net/jtv_user_pictures/xarth/404_user_70x70.png"; if(data){ $scope.$applyAsync(function(){ data.class = "user" + $scope.index; $scope.userlist.push(data); console.log(data.class); $timeout(function(){ console.log("timeout"); $(".user" + $scope.index).animate({ opacity: 1 } , 1500 , function(){ console.log("animate end"); $(".user" + $scope.index).addClass("fullopactity"); }); $(".user" + $scope.index).on('mouseover', function(){ $(this).addClass('scale'); $(this).removeClass('without-scale'); }); $(".user" + $scope.index).on('mouseout', function(){ $(this).removeClass('scale'); $(this).addClass('without-scale'); }); $scope.index++; } , 100); }) } }); }) //https://api.twitch.tv/kraken/streams/dpismenny //https://api.twitch.tv/kraken/streams/freecodecamp?callback=? //https://api.twitch.tv/kraken/channels/freecodecamp/follows?direction=DESC&limit=25 //https://api.twitch.tv/kraken/users/freecodecamp?client_id=5j0r5b7qb7kro03fvka3o8kbq262wwm //https://api.twitch.tv/kraken/beta/streams/random });
}]);
Developer | Paulo Sérgio |
Username | paulo101977 |
Uploaded | November 19, 2022 |
Rating | 3 |
Size | 3,631 Kb |
Views | 22,264 |
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 |
Quote Api | 3,963 Kb |
Spinner pure CSS loader radius | 2,236 Kb |
WeatherMap | 13,360 Kb |
Spinner Loader SVG Pure Css Radius Loader | 2,148 Kb |
Tributo a Renato Russo | 5,611 Kb |
Tic Tac Toe Game | 6,111 Kb |
Wiki Search | 3,062 Kb |
Pomodoro Clock | 3,306 Kb |
Project Singapoure | 4,037 Kb |
D3js SVG Clip Path | 5,740 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 |
See Through | Larrygeams | 77,410 Kb |
Cool audio | Bigliam | 1,868 Kb |
Pure CSS candle light animation by One element | Ksksoft | 2,193 Kb |
RAQuote | Naderk007 | 4,412 Kb |
Content Changer | Cliffpyles | 4,538 Kb |
A bit of elegance | Hackthevoid | 9,095 Kb |
Css3 only dropdown menu | Riogrande | 2,519 Kb |
A Pen by Adrien Clerbois | AClerbois | 6,501 Kb |
Polygon Dodecahedron in CSS | Vennsoh | 7,606 Kb |
Canvas Orbital Trails v2 | Jackrugile | 3,421 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!