<commit_before><!DOCTYPE HTML>
<html>
  <head>
    <title>&lt;audio&gt; Client for "Node Icecast Server": node-icecast-stack</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/prototype/1.6.1.0/prototype.js"></script>
    <script type="text/javascript">
      window.onload = function() {

        // This 'poll()' function polls for 'metadata' events from the radio stream
        function poll(force) {
          var headers = {};
          if (force) headers['X-Current-Track'] = 1;
          new Ajax.Request("/metadata", {
            onSuccess: function(r) {
              if (r.responseText) {
                $('events').innerHTML += r.responseText + "\n";
              }
              poll();
            },
            onFailure: function(r) {
              console.error(r);
            },
            requestHeaders: headers
          });
        }
        poll(true);

        // We'll use 'canPlayType' to determine which file format to request
        var audio = $$("audio")[0];
        if (audio.canPlayType('application/ogg; codecs="vorbis"') == "probably"
            && (/Chrome/i.test(navigator.userAgent) || !/Safari/i.test(navigator.userAgent))) {
          audio.src = "/stream.ogg";
        }
        console.log("loading " + audio.src);
        audio.load();
        audio.play();
      }
    </script>
  </head>
  <body style="text-align:center;">
    <audio src="/stream.mp3" controls></audio>
    <br />
    <textarea id="events" style="width:500px;height:300px;">"metadata" events will be printed here...
</textarea>
  </body>
</html>
<commit_msg>Use GETs when getting the metadata. Also, dynamically insert the <audio> tag during 'onload', for better browser cross-compatibility.<commit_after><!DOCTYPE HTML>
<html>
  <head>
    <title>&lt;audio&gt; Client for "Node Icecast Server": node-icecast-stack</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/prototype/1.6.1.0/prototype.js"></script>
    <script type="text/javascript">
      window.onload = function() {

        // This 'poll()' function polls for 'metadata' events from the radio stream
        function poll(force) {
          var headers = {};
          if (force) headers['X-Current-Track'] = 1;
          new Ajax.Request("/metadata", {
            method: 'get',
            onSuccess: function(r) {
              if (r.responseText) {
                $('events').innerHTML += r.responseText + "\n";
              }
              poll();
            },
            onFailure: function(r) {
              console.error(r);
            },
            requestHeaders: headers
          });
        }
        poll(true);

        // We'll use 'canPlayType' to determine which file format to request
        var audio = new Audio();
        if (audio.canPlayType('application/ogg; codecs="vorbis"') == "probably"
            && (/Chrome/i.test(navigator.userAgent) || !/Safari/i.test(navigator.userAgent))) {
          audio.src = "/stream.ogg";
        } else {
          audio.src = "stream.mp3";
        }
        audio.setAttribute('controls', true);
        document.body.insert({top:audio});
        console.log("loading " + audio.src);
        audio.load();
        audio.play();
      }
    </script>
  </head>
  <body style="text-align:center;">
    <br />
    <textarea id="events" style="width:500px;height:300px;">"metadata" events will be printed here...
</textarea>
  </body>
</html>

{'fraction_non_alphanumeric': 0.16190740227335737, 'fraction_numerical': 0.00748544496811755, 'mean_word_length': 2.1593695271453592, 'pattern_counts': {'":': 2, '<': 40, '<?xml version=': 0, '>': 40, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2069908', 'n_tokens_mistral': 1091, 'n_tokens_neox': 1048, 'n_words': 225}