<commit_before><?php

// You must define these with real values
$beacon_host = '';
$preview_host = '';
$tracking_code = '';

// Perform requested actions
$action = $_GET['action'];
switch ($action) {
	case 'rxn_pageview':
	case 'rxn_impression':
		_beacon_call($beacon_host, $tracking_code);
		break;
	case 'rxn_preview':
		_preview_pull($preview_host, $_GET['rxn_preview']);
		break;
}
exit;

function _preview_pull($host, $key)
{
	$url = $host . '/js/' . $key . '/preview.js';
	header("Cache-Control: no-cache, no-store, must-revalidate");
	header("Pragma: no-cache");
	header("Expires: 0");
	header('Content-type: text/javascript');
	echo _curl_get($url)
}

function _beacon_call($host, $key)
{
	$user_agent = empty($_SERVER['HTTP_USER_AGENT']) ? '' : $_SERVER['HTTP_USER_AGENT'];
	$ip = '';
	if ( ! empty($_SERVER["HTTP_X_FORWARDED_FOR"]))
		$ip = $_SERVER["HTTP_X_FORWARDED_FOR"];
	elseif ( ! empty($_SERVER['HTTP_X_FORWARDED']))
		$ip = $_SERVER['HTTP_X_FORWARDED'];
	elseif ( ! empty($_SERVER['HTTP_FORWARDED_FOR']))
		$ip = $_SERVER['HTTP_FORWARDED_FOR'];
	elseif ( ! empty($_SERVER['HTTP_FORWARDED']))
		$ip = $_SERVER['HTTP_FORWARDED'];
	elseif ( ! empty($_SERVER['REMOTE_ADDR']))
		$ip = $_SERVER['REMOTE_ADDR'];

	$url = $host . '/abl.php?tracking_code=' . $key;
	$url .= '&ua=' . urlencode($user_agent);
	$url .= '&ip=' . urlencode($ip);
	$url .= '&' . $_SERVER['QUERY_STRING'];
	_curl_get($url);

	header("Cache-Control: no-cache, no-store, must-revalidate");
	header("Pragma: no-cache");
	header("Expires: 0");
	header('Content-Type: image/gif');<commit_msg>fix minor bugs<commit_after><?php

// You must define these with real values
$beacon_host = '';
$preview_host = '';
$tracking_code = '';

// Perform requested actions
$action = $_GET['action'];
switch ($action) {
	case 'rxn_pageview':
	case 'rxn_impression':
		_beacon_call($beacon_host, $tracking_code);
		break;
	case 'rxn_preview':
		_preview_pull($preview_host, $_GET['rxn_preview']);
		break;
}
exit;

function _preview_pull($host, $key)
{
	$url = $host . '/js/' . $key . '/preview.js';
	header("Cache-Control: no-cache, no-store, must-revalidate");
	header("Pragma: no-cache");
	header("Expires: 0");
	header('Content-type: text/javascript');
	echo _curl_get($url);
}

function _beacon_call($host, $key)
{
	$user_agent = empty($_SERVER['HTTP_USER_AGENT']) ? '' : $_SERVER['HTTP_USER_AGENT'];
	$ip = '';
	if ( ! empty($_SERVER["HTTP_X_FORWARDED_FOR"]))
		$ip = $_SERVER["HTTP_X_FORWARDED_FOR"];
	elseif ( ! empty($_SERVER['HTTP_X_FORWARDED']))
		$ip = $_SERVER['HTTP_X_FORWARDED'];
	elseif ( ! empty($_SERVER['HTTP_FORWARDED_FOR']))
		$ip = $_SERVER['HTTP_FORWARDED_FOR'];
	elseif ( ! empty($_SERVER['HTTP_FORWARDED']))
		$ip = $_SERVER['HTTP_FORWARDED'];
	elseif ( ! empty($_SERVER['REMOTE_ADDR']))
		$ip = $_SERVER['REMOTE_ADDR'];

	$url = $host . '/abl.php?tracking_code=' . $key;
	$url .= '&ua=' . urlencode($user_agent);
	$url .= '&ip=' . urlencode($ip);
	$url .= '&' . $_SERVER['QUERY_STRING'];
	_curl_get($url);

	header("Cache-Control: no-cache, no-store, must-revalidate");
	header("Pragma: no-cache");
	header("Expires: 0");
	header('Content-Type: image/gif');
{'fraction_non_alphanumeric': 0.21060991105463786, 'fraction_numerical': 0.0012706480304955528, 'mean_word_length': 5.714285714285714, 'pattern_counts': {'":': 0, '<': 5, '<?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': '7420588', 'n_tokens_mistral': 1221, 'n_tokens_neox': 1186, 'n_words': 203}