Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var executed = false;
- setInterval(() => {
- $.ajax({
- type: 'GET',
- url: 'https://api.twitch.tv/helix/streams?user_login=username',
- dataType: 'json',
- headers: {
- 'Client-Id': 'clientid',
- 'Authorization': 'token'
- },
- success: function(channel) {
- if (channel["data"] == "") {
- executed = false;
- } else {
- if (!executed) {
- //do stuff
- executed = true;
- }
- }
- }
- });
- }, 2000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement