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

exports.init = function (y, config, messages, cron, logger) {
	var yammer_account = config.yammer[config.yammer_account];

	var getHTML = function () {
		var html = ''
			+ '<!DOCTYPE html>'
			+ '<html lang="en">'
			+ '<head>'
			+ '<meta charset="utf-8" />'
			+ '<title>PID ' + process.pid + ' ' + y.userAgent() + '</title>'
			+ '</head>'
			+ '<body>'
			+ '<p><strong>PID ' + process.pid + ' ' + y.userAgent() + '</strong></p>'
			+ '<p><strong>' + yammer_account.email + '</strong></p>'
			+ '<dl>'
			+ '</dl>'
			+ '<h2>Open Threads</h2>'
			+ '<dl>';

		var threads = y.openThreads();
		for (var i = 0; i < threads.length; i++) {
			var thread = threads[i];
			
			html += '<dt>' + thread.id() + '</dt>'
				+ '<dd><pre>' + util.inspect(thread, false, 3) + '</pre></dd>';
		}

		html += ''
			+ '</dl>'
			+ '<h2>Closed Threads</h2>'
			+ '<dl>';

		threads = y.closedThreads();
		for (var i = 0; i < threads.length; i++) {
			var thread = threads[i];
			
			html += '<dt>' + thread.id() + '</dt>'
				+ '<dd><pre>' + util.inspect(thread, false, 3) + '</pre></dd>';
		}

		html += ''
			+ '</dl>'
			+ '</body>'
			+ '</html>';

		return html;
	};

	var http = require('http');
	http.createServer(function (req, res) {
		res.writeHead(200, {'Content-Type': 'text/html'});
		res.end(getHTML());
	}).listen(1337, "0.0.0.0");

};
<commit_msg>Read IP and port from the configuration file<commit_after>var util = require('util');

exports.init = function (y, config, messages, cron, logger) {
	var yammer_account = config.yammer[config.yammer_account];

	var getHTML = function () {
		var html = ''
			+ '<!DOCTYPE html>'
			+ '<html lang="en">'
			+ '<head>'
			+ '<meta charset="utf-8" />'
			+ '<title>PID ' + process.pid + ' ' + y.userAgent() + '</title>'
			+ '</head>'
			+ '<body>'
			+ '<p><strong>PID ' + process.pid + ' ' + y.userAgent() + '</strong></p>'
			+ '<p><strong>' + yammer_account.email + '</strong></p>'
			+ '<dl>'
			+ '</dl>'
			+ '<h2>Open Threads</h2>'
			+ '<dl>';

		var threads = y.openThreads();
		for (var i = 0; i < threads.length; i++) {
			var thread = threads[i];
			
			html += '<dt>' + thread.id() + '</dt>'
				+ '<dd><pre>' + util.inspect(thread, false, 3) + '</pre></dd>';
		}

		html += ''
			+ '</dl>'
			+ '<h2>Closed Threads</h2>'
			+ '<dl>';

		threads = y.closedThreads();
		for (var i = 0; i < threads.length; i++) {
			var thread = threads[i];
			
			html += '<dt>' + thread.id() + '</dt>'
				+ '<dd><pre>' + util.inspect(thread, false, 3) + '</pre></dd>';
		}

		html += ''
			+ '</dl>'
			+ '</body>'
			+ '</html>';

		return html;
	};

	var http = require('http');
	http.createServer(function (req, res) {
		res.writeHead(200, {'Content-Type': 'text/html'});
		res.end(getHTML());
	}).listen(config.webinterface.port, config.webinterface.ip);

};

{'fraction_non_alphanumeric': 0.2612201963534362, 'fraction_numerical': 0.011220196353436185, 'mean_word_length': 2.957004160887656, 'pattern_counts': {'":': 0, '<': 87, '<?xml version=': 0, '>': 83, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, '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': '3184054', 'n_tokens_mistral': 1254, 'n_tokens_neox': 1071, 'n_words': 225}