<commit_before>var https = require('https');

var BASE_URL = 'http://isithackday.com/arrpi.php';

exports.getYoloPirates = function (msg, callback) {
	http.get(encodeURI(base+'?text='+msg), function (res) {
		var pageData = "";
		res.on('data', function (chunk) {
			pageData += chunk;
		});

		res.on('end', function() {
			callback(pageData);
		});

	}).on('error', function (e) {
		console.log("Got error: " + e.message);
	});
}

<commit_msg>Callback returns json with yolo error key<commit_after>var https = require('https');

var BASE_URL = 'http://isithackday.com/arrpi.php';

exports.getYoloPirates = function (msg, callback) {
	var retVal = { err: false, translation: '' };

	http.get(encodeURI(base+'?text='+msg), function (res) {
		var pageData = "";
		res.on('data', function (chunk) {
			pageData += chunk;
		});

		res.on('end', function() {
			console.log("Success: " + pageData);
			retVal.translation = pageData;
			callback(retVal);
		});

	}).on('error', function (e) {
		console.log("Got error: " + e.message);
		retVal.err = true;
		callback(retVal);
	});
}


{'fraction_non_alphanumeric': 0.19833178869323448, 'fraction_numerical': 0.0, 'mean_word_length': 4.142857142857143, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4508154', 'n_tokens_mistral': 421, 'n_tokens_neox': 386, 'n_words': 76}