<commit_before>// Twitch url and streams to fetch data about
var streams = ["freecodecamp", "storbeck", "terakilobyte", "habathcx","RobotCaleb","comster404","brunofin","thomasballinger","noobs2ninjas","beohoff","medrybw"],
    twitch_url = "https://api.twitch.tv/kraken/";

// Creates an array with all future ajax calls
var ajaxArr = streams.map(function(stream) {
    return $.ajax({
        url: twitch_url + "channels/" + stream,
        dataType: "jsonp",
        success: function() {
            $('.loading').append(".");
        }
    });
}).concat(streams.map(function(stream) {
    return $.ajax({
        url: twitch_url + "streams/" + stream,
        dataType: "jsonp",
        success: function() {
            $('.loading').append(".");
        }
    });
}));

// Wait for document to load until document dependent code is run.
$(document).ready(function() {

    $('main').empty().append("<div class='loading'>Loading</div>");

    // Runs all ajax calls and calls the callback with their results as arguments
    $.when.apply($, ajaxArr).done(function() {

        // Create array from arguments
        args = Array.prototype.slice.call(arguments);

        // Remove loading message
        $('main').empty();

        // Create an array with appropriate HTML for every stream
        args.forEach(function(stream) {
            // Return if ajax request was unsuccessfull or 
            // if it's not a channel request (i.e. if it's a stream request)
            if(stream[1] !== "success" || stream[0].display_name === undefined) {
                return false;
            }

            // Get stream information<commit_msg>Zipline: Twitch API - Some cleanup/styling<commit_after>// Twitch url and streams to fetch data about
var streams = ["freecodecamp", "storbeck", "terakilobyte", "habathcx", "RobotCaleb", "comster404", "brunofin", "thomasballinger", "noobs2ninjas", "beohoff", "medrybw"],
    twitchUrl = "https://api.twitch.tv/kraken/";

// Creates an array with all future ajax calls
var ajaxArr = streams.map(function(stream) {
    return $.ajax({
        url: twitchUrl + "channels/" + stream,
        dataType: "jsonp",
        success: function() {
            $(".loading").append(".");
        }
    });
}).concat(streams.map(function(stream) {
    return $.ajax({
        url: twitchUrl + "streams/" + stream,
        dataType: "jsonp",
        success: function() {
            $('.loading').append(".");
        }
    });
}));

// Wait for document to load until document dependent code is run.
$(document).ready(function() {

    $('main').empty().append("<div class='loading'>Loading</div>");

    // Runs all ajax calls and calls the callback with their results as arguments
    $.when.apply($, ajaxArr).done(function() {

        // Create array from arguments
        args = Array.prototype.slice.call(arguments);

        // Remove loading message
        $('main').empty();

        // Create an array with appropriate HTML for every stream
        args.forEach(function(stream) {
            // Return if ajax request was unsuccessfull or 
            // if it's not a channel request (i.e. if it's a stream request)
            if(stream[1] !== "success" || stream[0].display_name === undefined) {
                return false;
            }

            // Get stream information
{'fraction_non_alphanumeric': 0.1516061242870009, 'fraction_numerical': 0.003602521765235665, 'mean_word_length': 2.496327387198321, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2577345', 'n_tokens_mistral': 960, 'n_tokens_neox': 922, 'n_words': 266}