<commit_before><?
// The source code packaged with this file is Free Software, Copyright (C) 2005 by
// <NAME> <gallir at uib dot es>.
// It's licensed under the AFFERO GENERAL PUBLIC LICENSE unless stated otherwise.
// You can get copies of the licenses here:
// 		http://www.affero.org/oagpl.html
// AFFERO GENERAL PUBLIC LICENSE is also included in the file called "COPYING".

function check_stats($string) {
	global $globals, $current_user;
	if (preg_match('/^!top/', $string)) return do_top($string);
	if (preg_match('/^!statsu/', $string)) return do_statsu($string);
	if (preg_match('/^!stats2/', $string)) return do_stats2($string);
	if (preg_match('/^!stats3/', $string)) return do_stats3($string);
	if (preg_match('/^!stats1{0,1}/', $string)) return do_stats1($string);
	if (preg_match('/^!time/', $string)) return date(" d-m-Y H:i:s T");
	if (preg_match('/^!help/', $string)) return _('comandos') . ': http://meneame.wikispaces.com/Comandos';
	if (preg_match('/^!cabal/', $string)) return do_cabal($string);
	if (preg_match('/^!dariaunojo/', $string)) return do_ojo($string);
	if (preg_match('/^!wiki/', $string)) return 'wiki: http://meneame.wikispaces.com/';
	if (preg_match('/^!promote/', $string)) return 'http://' . get_server_name().$globals['base_url']. 'promote.php';
	if (preg_match('/^!hoygan/', $string)) return '¡HOYGAN! BISITEN http://' . get_server_name().$globals['base_url']. 'sneak.php?hoygan=1 GRASIAS DE HANTEMANO';
	if (preg_match('/^!webstats/', $string)) return 'http://www.quantcast.com/'.get_server_name();
	if (preg_match('/^!ignore/', $string)) return do_ignore($string);
	if (preg_match('/^!admins/', $string)) return do_admins($string);
	if (preg_match('/^!last/', $string)) return do_last($string);
	if (preg_match('/^!gs/', $string)) return do_fon_gs($string);
	if (preg_match('/^!rae/', $string)) return do_rae($string);
	if (preg_match('/^!values/', $string)) return do_values();
	if (preg_match('/^!load/', $string)) return do_load();
	return false;
}

function do_load() {
	global $db, $current_user;
	$annotation = new Annotation('ec2-autoscaler');
	if (!$annotation->read()) {
		return _('no hay estadísticas disponibles');
	}
	$group = unserialize($annotation->text);
	$str = "web instances: $group->instances, ";
	$str .= "cpu average load: ".round($group->load, 2) . "%, ";
	$str .= "cpu max average ($group->measures periods): ".round($group->load_max, 2)."%, ";
	$str .= "stored at: ". get_date_time($annotation->time);
	return $str;
}

function do_admins($string) {
	global $db, $current_user;

	if (! $current_user->admin) return false;
	foreach (array('god', 'admin') as $level) {
		$res = $db->get_col("select user_login from users where user_level = '$level' and user_id != $current_user->user_id order by user_login asc");
		if ($res) {
			$comment .= "<strong>$level</strong>: ";
			foreach ($res as $user) {
				$comment .= $user . ' ';
			}
		}
		$comment .= "<br>";
	}
	return $comment;
}

function do_last($string) {
	global $db, $current_user;
<commit_msg>Agregado comando bloggers<commit_after><?
// The source code packaged with this file is Free Software, Copyright (C) 2005 by
// <NAME> <gallir at uib dot es>.
// It's licensed under the AFFERO GENERAL PUBLIC LICENSE unless stated otherwise.
// You can get copies of the licenses here:
// 		http://www.affero.org/oagpl.html
// AFFERO GENERAL PUBLIC LICENSE is also included in the file called "COPYING".

function check_stats($string) {
	global $globals, $current_user;
	if (preg_match('/^!top/', $string)) return do_top($string);
	if (preg_match('/^!statsu/', $string)) return do_statsu($string);
	if (preg_match('/^!stats2/', $string)) return do_stats2($string);
	if (preg_match('/^!stats3/', $string)) return do_stats3($string);
	if (preg_match('/^!stats1{0,1}/', $string)) return do_stats1($string);
	if (preg_match('/^!time/', $string)) return date(" d-m-Y H:i:s T");
	if (preg_match('/^!help/', $string)) return _('comandos') . ': http://meneame.wikispaces.com/Comandos';
	if (preg_match('/^!cabal/', $string)) return do_cabal($string);
	if (preg_match('/^!dariaunojo/', $string)) return do_ojo($string);
	if (preg_match('/^!wiki/', $string)) return 'wiki: http://meneame.wikispaces.com/';
	if (preg_match('/^!promote/', $string)) return 'http://' . get_server_name().$globals['base_url']. 'promote.php';
	if (preg_match('/^!hoygan/', $string)) return '¡HOYGAN! BISITEN http://' . get_server_name().$globals['base_url']. 'sneak.php?hoygan=1 GRASIAS DE HANTEMANO';
	if (preg_match('/^!webstats/', $string)) return 'http://www.quantcast.com/'.get_server_name();
	if (preg_match('/^!ignore/', $string)) return do_ignore($string);
	if (preg_match('/^!admins/', $string)) return do_admins($string);
	if (preg_match('/^!bloggers/', $string)) return do_bloggers($string);
	if (preg_match('/^!last/', $string)) return do_last($string);
	if (preg_match('/^!gs/', $string)) return do_fon_gs($string);
	if (preg_match('/^!rae/', $string)) return do_rae($string);
	if (preg_match('/^!values/', $string)) return do_values();
	if (preg_match('/^!load/', $string)) return do_load();
	return false;
}

function do_load() {
	global $db, $current_user;
	$annotation = new Annotation('ec2-autoscaler');
	if (!$annotation->read()) {
		return _('no hay estadísticas disponibles');
	}
	$group = unserialize($annotation->text);
	$str = "web instances: $group->instances, ";
	$str .= "cpu average load: ".round($group->load, 2) . "%, ";
	$str .= "cpu max average ($group->measures periods): ".round($group->load_max, 2)."%, ";
	$str .= "stored at: ". get_date_time($annotation->time);
	return $str;
}

function do_admins($string) {
	global $db, $current_user;

	if (! $current_user->admin) return false;
	foreach (array('god', 'admin') as $level) {
		$res = $db->get_col("select user_login from users where user_level = '$level' and user_id != $current_user->user_id order by user_login asc");
		if ($res) {
			$comment .= "<strong>$level</strong>: ";
			foreach ($res as $user) {
				$comment .= $user . ' ';
			}
		}
		$comment .= "<br>";
	}
	return $comment;
}

function do_bloggers($string) {
	global $db, $current_user;

	if (! $current_user->admin) return false;
	foreach (array('blogger') as $level) {
		$res = $db->get_col("select user_login from users where user_level = '$level' and user_id != $current_user->user_id order by user_login asc");
		if ($res) {
			$comment .= "<strong>$level</strong>: ";
			foreach ($res as $user) {
				$comment .= $user . ' ';
			}
		}
		$comment .= "<br>";
	}
	return $comment;
}

function do_last($string) {
	global $db, $current_user;

{'fraction_non_alphanumeric': 0.20908676492934206, 'fraction_numerical': 0.004862482905333536, 'mean_word_length': 4.994535519125683, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '5992963', 'n_tokens_mistral': 2508, 'n_tokens_neox': 2414, 'n_words': 575}