<commit_before><?php
error_reporting(E_ALL);

require_once (__DIR__ . '/../src/bot.php');

$bot = new PimOnlineBot(false);
$online = false;
/*
 * When called from the command line, emulate a HTTP GET/POST
 */
if (! isset($_SERVER["HTTP_HOST"]) && $argc > 1)
{
        parse_str($argv[1], $_GET);
        parse_str($argv[1], $_POST);
        parse_str($argv[1], $_REQUEST);
}

if (isset($_SERVER["HTTP_HOST"]))
{
    $online = true;
}

/*
 * uid is set -> update from a server
 */
if (isset($_REQUEST['uid']))
{
    /*
     * Disable varnish cache for updates
     */
    if (isset($_SERVER["HTTP_HOST"]))
    {
        header('Cache-Control: max-age=0');
    }

    $bot->online($_REQUEST['uid']);
}
else if (isset($_REQUEST['cron']))
{
    /*
     * Manual update, generally from cron, but at this time can be forced
     * through HTTP.
     */
    $bot->udpate_db();
}
else
{
    /*
     * Call that only when offline, the hooks *must* be used when online.
     */
    if (!$online)
    {
        $bot->bot();
    }
}

if (!$online)
{
    /*
     * Say hello
     */
    $c = $bot->server_count();
    echo "server_count = $c\n";
}

if ($online && !isset($_REQUEST['uid']))
{
$html =<<<EOT
<!DOCTYPE html>
<html>
<head>
<style>
body
{
font-family:sans
}
</style>
</head>
<body>

<h1>Welcome to PimOnlineBot</h1>
<p>Receive a telegram when your host is offline.</p>
<h2>Telegram side</h2>
Talk to the <a href="https://telegram.me/PimOnlineBot">bot</a>, then ask for <b>/help</b>.
<h2>Host side<h2>
The current help is only on the bot side.
<h2>License and sources</h2>
© 2017 <NAME>, licensed under the <a href="https://www.gnu.org/licenses/agpl-3.0.en.html">AGPL v3</a>, sources on <a href="https://github.com/RandomReaper/OnlineBot">github</a>.
</body>
</html>
EOT;

    echo $html;
}
<commit_msg>google analytics<commit_after><?php
error_reporting(E_ALL);

require_once (__DIR__ . '/../src/bot.php');

$bot = new PimOnlineBot(false);
$online = false;
/*
 * When called from the command line, emulate a HTTP GET/POST
 */
if (! isset($_SERVER["HTTP_HOST"]) && $argc > 1)
{
        parse_str($argv[1], $_GET);
        parse_str($argv[1], $_POST);
        parse_str($argv[1], $_REQUEST);
}

if (isset($_SERVER["HTTP_HOST"]))
{
    $online = true;
}

/*
 * uid is set -> update from a server
 */
if (isset($_REQUEST['uid']))
{
    /*
     * Disable varnish cache for updates
     */
    if (isset($_SERVER["HTTP_HOST"]))
    {
        header('Cache-Control: max-age=0');
    }

    $bot->online($_REQUEST['uid']);
}
else if (isset($_REQUEST['cron']))
{
    /*
     * Manual update, generally from cron, but at this time can be forced
     * through HTTP.
     */
    $bot->udpate_db();
}
else
{
    /*
     * Call that only when offline, the hooks *must* be used when online.
     */
    if (!$online)
    {
        $bot->bot();
    }
}

if (!$online)
{
    /*
     * Say hello
     */
    $c = $bot->server_count();
    echo "server_count = $c\n";
}

if ($online && !isset($_REQUEST['uid']))
{
$html =<<<EOT
<!DOCTYPE html>
<html>
<head>
<!-- Global site tag (gtag.js) - Google Analytics -->
<meta name="google-site-verification" content="<KEY>" />
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-119405595-1"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'UA-119405595-1');
</script>
<style>
body
{
font-family:sans
}
</style>
</head>
<body>

<h1>Welcome to PimOnlineBot</h1>
<p>Receive a telegram when your host is offline.</p>
<h2>Telegram side</h2>
Talk to the <a href="https://telegram.me/PimOnlineBot">bot</a>, then ask for <b>/help</b>.
<h2>Host side<h2>
The current help is only on the bot side.
<h2>License and sources</h2>
© 2017 <NAME>, licensed under the <a href="https://www.gnu.org/licenses/agpl-3.0.en.html">AGPL v3</a>, sources on <a href="https://github.com/RandomReaper/OnlineBot">github</a>.
</body>
</html>
EOT;

    echo $html;
}

{'fraction_non_alphanumeric': 0.19808949220713926, 'fraction_numerical': 0.015082956259426848, 'mean_word_length': 3.1752360965372506, 'pattern_counts': {'":': 0, '<': 74, '<?xml version=': 0, '>': 78, 'https://': 7, 'lorem ipsum': 0, 'www.': 3, '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': '1825302', 'n_tokens_mistral': 1511, 'n_tokens_neox': 1461, 'n_words': 354}