I need help with code

Hi, i finded some code but with wrong twitch api and i need help to change this code to a good twitch api

var channels = ["OgamingSC2", "cretetion", "freecodecamp", "habathcx", "RobotCaleb", "noobs2ninjas", "brunofin", "comster404"];

function getChannelInfo() {

    channels.forEach(function (channel) {

        function makeURL(type, name) {

            return 'https://wind-bow.gomix.me/twitch-api/' + type + '/' + name + '?callback=?';

        };

        $.getJSON(makeURL("streams", channel), function (data) {

            var game,

                status;

            if (data.stream === null) {

                game = "Offline";

                status = "offline";

            } else if (data.stream === undefined) {

                game = "Account Closed";

                status = "offline";

            } else {

                game = "Online";

                status = "online";

            };

            $.getJSON(makeURL("channels", channel), function (data) {

                var logo = data.logo != null ? data.logo : "https://dummyimage.com/50x50/ecf0e7/5c5457.jpg&text=0x3F",

                    name = data.display_name != null ? data.display_name : channel,

                    description = status === "online" ? ': ' + data.status : "";

                logoth = '<div class="userlogo ' + status + '"><img src="' + logo + '" class="logo"><div id="name"><a href="' +

                    data.url + '" target="_blank"></th>';

                nameth = '<div class="user ' + status + '"><a href="' + data.url + '" target="_blank">' + name + '</a></div>'

                statth = '<div class="status ' + status + '"><div class="statem">' + game + '</div>'

                status === "online" ? $("#display").prepend(logoth) : $("#display").append(logoth);

                status === "online" ? $("#disname").prepend(nameth) : $("#disname").append(nameth);

                status === "online" ? $("#disstat").prepend(statth) : $("#disstat").append(statth);

            });

        });

    });

};

$(document).ready(function () {

    getChannelInfo();

    $(".tablinks").click(function () {

        $(".tablinks").removeClass("active");

        $(this).addClass("active");

        var status = $(this).attr('id');

        if (status === "all") {

            $(".online, .offline").removeClass("hidden");

        } else if (status === "online") {

            $(".online").removeClass("hidden");

            $(".offline").addClass("hidden");

        } else {

            $(".offline").removeClass("hidden");

            $(".online").addClass("hidden");

        };

    })

});

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.