<commit_before>function fetchJson(HOST, DIR) {
    var xhr = new XMLHttpRequest();
    xhr.onreadystatechange = function() {
        if (xhr.status == 404) {
            response = "";
        } else if (xhr.readyState == 4) {
            response = xhr.responseText;
        }
    }

    var dateList = Date().toString().split(" ");
    var filename = dateList[1] + "-" + parseInt(dateList[2]) + "-" + dateList[3];
    var url = HOST + DIR + filename + ".json";

    xhr.open("GET", url, false);
    xhr.send();

    if (this.response == "") {
        return "";
    }
    return JSON.parse("[" + this.response.substring(0, this.response.length - 1) + "]");
}


function loadJson() {
    var channel = "nchusg.it";

    var data = fetchJson("http://irc.nchusg.org/logbot", "/static/data/" + channel + "/");
    var dataLen = data.length;

    var dateList = Date().toString().split(" ");
    var filename = dateList[1] + "-" + parseInt(dateList[2]) + "-" + dateList[3];

    document.getElementById("channel").innerHTML = "#" + channel;
    document.getElementById("date").innerHTML = filename;

    logs = document.getElementById('logs');

    if (data == "") {
        logs.innerHTML = "<li class='msg'>No one speaks yet :-)</li>";
        return;
    }

    if (lastLine == dataLen) {
        return;
    }

    ele = ['time', 'name', 'content'];
    for (i = lastLine; i < dataLen; i++) {
        msg = "<li class='msg' id='" + i + "'>";
        for (j = 0; j < 3; j++) {
            msg += "<span class='" + ele[j] + "'>" + data[i][ele[j]] + "</span>";
        }
        msg += "</li>";<commit_msg>The log file will be choosed by the hash tag in the web address.<commit_after>var Month = Array("","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");

function fetchJson(HOST, DIR) {
    var xhr = new XMLHttpRequest();
    xhr.onreadystatechange = function() {
        if (xhr.status == 404) {
            response = "";
        } else if (xhr.readyState == 4) {
            response = xhr.responseText;
        }
    }

    //var dateList = Date().toString().split(" ");
    //var filename = dateList[1] + "-" + parseInt(dateList[2]) + "-" + dateList[3];
  	if(location.hash.length!=0){
		var dateList = location.hash.substr(1).split("-");
		var filename = Month[dateList[1]] + "-" + parseInt(dateList[2]) + "-" + dateList[0];
		
	}else{
		var dateList = Date().toString().split(" ");
		var filename = dateList[1] + "-" + parseInt(dateList[2]) + "-" + dateList[3];
	}


	var url = HOST + DIR + filename + ".json";

    xhr.open("GET", url, false);
    xhr.send();

    if (this.response == "") {
        return "";
    }
    return JSON.parse("[" + this.response.substring(0, this.response.length - 1) + "]");
}


function loadJson() {
    var channel = "nchusg.it";

    var data = fetchJson("http://irc.nchusg.org/logbot", "/static/data/" + channel + "/");
    var dataLen = data.length;
	

	if(location.hash.length!=0){
		var dateList = location.hash.substr(1).split("-");
		var filename = Month[dateList[1]] + "-" + parseInt(dateList[2]) + "-" + dateList[0];
		
	}else{
		var dateList = Date().toString().split(" ");
		var filename = dateList[1] + "-" + parseInt(dateList[2]) + "-" + dateList[3];
	}

    document.getElementById("channel").innerHTML = "#" + channel;
    document.getElementById("date").innerHTML = filename;

    logs = document.getElementById('logs');

    if (data == "") {
        logs.innerHTML = "<li class='msg'>No one speaks yet :-)</li>";
        return;
    }

    if (lastLine == dataLen) {
        return;
    }

    ele = ['time', 'name', 'content'];
    for (i = lastLine; i < dataLen; i++) {
        msg = "<li class='msg' id='" + i + "'>";
        for (j = 0; j < 3; j++) {
            msg += "<span class='" + ele[j] + "'>" + data[i][ele[j]] + "</span>";
        }
        msg += "</li>";
{'fraction_non_alphanumeric': 0.2156760965481443, 'fraction_numerical': 0.010641058915131067, 'mean_word_length': 2.575139146567718, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 15, 'https://': 0, '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': '5971719', 'n_tokens_mistral': 1325, 'n_tokens_neox': 1272, 'n_words': 273}