<commit_before><!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Primus</title>
  <script src="/primus/primus.js"></script>
  <link rel="stylesheet" href="http://getbootstrap.com/dist/css/bootstrap.css" />
  <style type="text/css">
    .jumbotron { background: #73146E; color: #FFF }
      .jumbotron h1 { font-size: 100px }
      .jumbotron .lead { color: rgba(255, 255, 255, .8) }

    .btn-outline-inverse { background: transparent; color: #F4CC05; border-color: #F4CC05; border-width: 2px }
      .btn-outline-inverse:hover { color: #73146E; background: #F4CC05 }

    #output { border-bottom: 115px solid #FFF }
    .output { margin: 1px 0; padding: 15px 30px 15px 15px; border-left: 5px solid #EEE }
      .output.output-reconnect { border-color: #C09853; background: #FCF8E3 }
      .output.output-error { border-color: #B94A48; background: #F2DEDE }
      .output.output-open { border-color: #468848; background: #DFF0D8 }
      .output.output-end { border-color: #333; background: #EEE }
      .output.output-network{ border-color: #D0E3F0; background: #F0F7FD }

    #action { position: fixed; bottom: 0; left: 0; width: 100%; padding: 10px 0; background: #FFF; border-top: 2px solid #EEE }
  </style>
</head>
<body>
  <div class="jumbotron">
    <div class="container">
      <h1>Twittery with Primus</h1>
      <p class="lead">
        This shows a live stream of tweets as they are inserted into our database
      </p>

      <p>
        <a href="#" id="connect" class="btn btn-outline-inverse btn-lg">
          connect
        </a>
      </p>
    </div>
  </div>

  <div id="output">
  </div>

  <script>
    var primus;

    function log(name, header, message) {
      var div = document.createElement('div');
      div.className = 'output output-'+ name;

      div.innerHTML = [
        '<h4>'+ header +'</h4>',
        message ? '<p>'+ message +'</p>' : ''
      ].join('');

      document.getElementById('output').appendChild(div);
      window.scroll(0, document.body.offsetHeight);
    }

    document.getElementById('connect').onclick = function click() {
      if (primus) primus.end();

      primus = new Primus();

      primus.on('reconnect', function reconnect(opts) {
        log('reconnect', 'Reconnecting', 'We are <strong>scheduling</strong> a new reconnect attempt. This is attempt <strong>'+ opts.attempt +'</strong> and will trigger a reconnect operation in <strong>'+ opts.timeout +'</strong> ms.');
        document.getElementById('connect').innerHTML = 'reconnecting';
      });

      primus.on('reconnect', function reconnect() {
        log('reconnect', 'Reconnect', 'Starting the reconnect attempt, hopefully we get a connection!');
      });

      primus.on('online', function online() {
        log('network', 'Online', 'We have regained control over our internet connection');
      });

      primus.on('offline', function online() {
        log('network', 'Offline', 'We lost our internet connection');
      });

      primus.on('open', function open() {
        log('open', 'Open', 'The connection has been established.');
        document.getElementById('connect').innerHTML = 'connected';
      });

      primus.on('error', function error(err) {
        log('error', 'Erorr', 'An unknown error has occured <code>'+ err.message +'</code>');
      });

      primus.on('data', function incoming(data) {
        log('data', 'Received data', 'string' === typeof data ? data : '<pre><code>'+ JSON.stringify(data, null, 2) +'</code></pre>');
      });

      primus.on('end', function end() {
        log('end', 'End', 'The connection has closed.');
        document.getElementById('connect').innerHTML = 'connect';
      });
    }
  </script><commit_msg>[fix] slim down printed text<commit_after><!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Primus</title>
  <script src="/primus/primus.js"></script>
  <link rel="stylesheet" href="http://getbootstrap.com/dist/css/bootstrap.css" />
  <style type="text/css">
    .jumbotron { background: #73146E; color: #FFF }
      .jumbotron h1 { font-size: 100px }
      .jumbotron .lead { color: rgba(255, 255, 255, .8) }

    .btn-outline-inverse { background: transparent; color: #F4CC05; border-color: #F4CC05; border-width: 2px }
      .btn-outline-inverse:hover { color: #73146E; background: #F4CC05 }

    #output { border-bottom: 115px solid #FFF }
    .output { margin: 1px 0; padding: 15px 30px 15px 15px; border-left: 5px solid #EEE }
      .output.output-reconnect { border-color: #C09853; background: #FCF8E3 }
      .output.output-error { border-color: #B94A48; background: #F2DEDE }
      .output.output-open { border-color: #468848; background: #DFF0D8 }
      .output.output-end { border-color: #333; background: #EEE }
      .output.output-network{ border-color: #D0E3F0; background: #F0F7FD }

    #action { position: fixed; bottom: 0; left: 0; width: 100%; padding: 10px 0; background: #FFF; border-top: 2px solid #EEE }
  </style>
</head>
<body>
  <div class="jumbotron">
    <div class="container">
      <h1>Twittery with Primus</h1>
      <p class="lead">
        This shows a live stream of tweets as they are inserted into our database
      </p>

      <p>
        <a href="#" id="connect" class="btn btn-outline-inverse btn-lg">
          connect
        </a>
      </p>
    </div>
  </div>

  <div id="output">
  </div>

  <script>
    var primus;

    function log(name, header, message) {
      var div = document.createElement('div');
      div.className = 'output output-'+ name;

      div.innerHTML = [
        '<h4>'+ header +'</h4>',
        message ? '<p>'+ message +'</p>' : ''
      ].join('');

      document.getElementById('output').appendChild(div);
      window.scroll(0, document.body.offsetHeight);
    }

    document.getElementById('connect').onclick = function click() {
      if (primus) primus.end();

      primus = new Primus();

      primus.on('reconnect', function reconnect(opts) {
        log('reconnect', 'Reconnecting', 'We are <strong>scheduling</strong> a new reconnect attempt. This is attempt <strong>'+ opts.attempt +'</strong> and will trigger a reconnect operation in <strong>'+ opts.timeout +'</strong> ms.');
        document.getElementById('connect').innerHTML = 'reconnecting';
      });

      primus.on('reconnect', function reconnect() {
        log('reconnect', 'Reconnect', 'Starting the reconnect attempt, hopefully we get a connection!');
      });

      primus.on('online', function online() {
        log('network', 'Online', 'We have regained control over our internet connection');
      });

      primus.on('offline', function online() {
        log('network', 'Offline', 'We lost our internet connection');
      });

      primus.on('open', function open() {
        log('open', 'Open', 'The connection has been established.');
        document.getElementById('connect').innerHTML = 'connected';
      });

      primus.on('error', function error(err) {
        log('error', 'Erorr', 'An unknown error has occured <code>'+ err.message +'</code>');
      });

      primus.on('data', function incoming(data) {
        log('data', 'Tweet', '<b>' + data.user + ':</b> ' + data.tweet);
      });

      primus.on('end', function end() {
        log('end', 'End', 'The connection has closed.');
        document.getElementById('connect').innerHTML = 'connect';
      });
    }
  </script>
{'fraction_non_alphanumeric': 0.17150182161651598, 'fraction_numerical': 0.024693023883416543, 'mean_word_length': 3.0151679306608883, 'pattern_counts': {'":': 0, '<': 91, '<?xml version=': 0, '>': 91, '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': '6154667', 'n_tokens_mistral': 2501, 'n_tokens_neox': 2326, 'n_words': 603}