{"size": 975, "ext": "js", "max_stars_repo_path": "play/static/js/main.js", "max_stars_repo_name": "totr/grawkit", "max_stars_repo_stars_event_min_datetime": "2016-12-31T18:52:13.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-17T11:29:56.000Z", "max_issues_repo_path": "play/static/js/main.js", "max_issues_repo_name": "totr/grawkit", "max_issues_repo_issues_event_min_datetime": "2017-01-13T10:30:37.000Z", "max_issues_repo_issues_event_max_datetime": "2021-05-04T14:52:22.000Z", "max_forks_repo_path": "play/static/js/main.js", "max_forks_repo_name": "totr/grawkit", "max_forks_repo_forks_event_min_datetime": "2018-04-22T12:42:29.000Z", "max_forks_repo_forks_event_max_datetime": "2021-05-25T09:26:48.000Z"}
{"max_stars_count": 135, "max_issues_count": 10, "max_forks_count": 21, "avg_line_length": 22.6744186047, "max_line_length": 90, "alphanum_fraction": 0.64}
var submitForm = function(el) {
	if (!el.action) {
		return false;
	}

	var req = new XMLHttpRequest();
	req.open('POST', el.action);
	req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');

	req.onreadystatechange = function() {
		if (this.readyState != 4) {
			return;
		}

		if (this.status == 200) {
			document.getElementById('generated').innerHTML = this.responseText;
			document.getElementById('error').innerHTML = '';
		} else {
			document.getElementById('error').innerHTML = this.getResponseHeader('X-Error-Message');
		}
	};

	var data = encodeFormData(new FormData(el)) + '&download';
	req.send(data);

	return true;
};

var encodeFormData = function(data) {
	var encode = function(s) {
		return encodeURIComponent(s).replace(/%20/g, '+');
	};

	var result = '';
	for (var entry of data.entries()) {
		if (typeof entry[1] == 'string') {
			result += (result ? '&' : '') + encode(entry[0]) + '=' + encode(entry[1]);
		}
	}

	return result;
};
