<commit_before><!doctype html>
<html class="no-js" lang="">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">

    <title><NAME> | Equisolve</title>

    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">
  </head>

  <body id="body" class="hidden-xs">
    <div class="container">
      <div class="row">
        <div class="col-xs-12">
          <h1 class="text-center">Latest Headlines</h1>
          <br/>
          <dl id="newsfeed" class="dl-horizontal"></dl>
          <section id="more"></section>
        </div>
      </div>
    </div>

    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">

    <!-- // <script src="https://cdnjs.cloudflare.com/ajax/libs/zepto/1.1.6/zepto.min.js"></script> -->

    <script type="text/javascript">
    (function(undefined) {
      'use strict';

      var body     = document.querySelector('#body');
      var more     = document.querySelector('#more');
      var newsfeed = document.querySelector('#newsfeed');
      var offset   = 0;
      var limit    = 20;
      var vpHeight = window.innerHeight;

      window.onload = onloadFn;
      window.onscroll = onscrollFn;

      function onloadFn() {

        var url = 'http://www.stellarbiotechnologies.com/media/press-releases/json';
        var params = { limit: limit, offset: offset };
        var query = url + setQueryString(params);

        var request = new XMLHttpRequest();

        request.open('GET', query, true);

        request.onload = function() {
          if (this.status >= 200 && this.status < 400) {
            setHeadlines(this.response);
          }
        };

        request.send();
      }

      function onscrollFn() {
        if (more.getBoundingClientRect().top <= vpHeight) {
          onloadFn();
        }
      }

      function setHeadlines(response) {

        var headlines = JSON.parse(response).news;

        if (headlines.length === 0) {
          return;
        }

        headlines.forEach(function(value, index, array) {

          var date  = value.published.substr(0,10);
          var title = value.title;

          var div = document.createElement('div');
          var dt  = document.createElement('dt');
          var dd  = document.createElement('dd');
          var br  = document.createElement('br');

          div.classList.add('item');

          dt.innerHTML = date;
          dd.innerHTML = title;

          div.appendChild(dt);
          div.appendChild(dd);
          div.appendChild(br);

          newsfeed.appendChild(div);
        });

        offset += limit;

        if (body.classList.contains('hidden-xs')) {
          body.classList.remove('hidden-xs');
        }
      }

      function setQueryString (params) {

        var queries = Object.keys(params).map(function(key) {
          return [key, '=', params[key]].join('');
        });

        return "?" + queries.join('&');
      }
    })();
    </script>
  </body>
</html><commit_msg>add lazy load<commit_after><!doctype html>
<html class="no-js" lang="">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">

    <title><NAME> | Equisolve</title>

    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">
  </head>

  <body id="body">
    <div class="container">
      <div class="row">
        <div class="col-xs-12">
          <h1 class="text-center">Latest Headlines</h1>
          <br/>
          <dl id="newsfeed" class="dl-horizontal"></dl>
          <h3 id="more" class="text-center">Getting headlines&hellip;</h3>
        </div>
      </div>
    </div>

    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">

    <script type="text/javascript">
    (function(undefined) {
      'use strict';

      var body     = document.querySelector('#body');
      var more     = document.querySelector('#more');
      var newsfeed = document.querySelector('#newsfeed');
      var offset   = 0;
      var limit    = 20;
      var vpHeight = window.innerHeight;

      window.onload = onloadFn;
      window.onscroll = onscrollFn;

      function onloadFn() {

        var url = 'http://www.stellarbiotechnologies.com/media/press-releases/json';
        var params = { limit: limit, offset: offset };
        var query = url + setQueryString(params);

        var request = new XMLHttpRequest();

        request.open('GET', query, true);

        request.onload = function() {
          if (this.status >= 200 && this.status < 400) {
            setHeadlines(this.response);
          }
        };

        request.send();
      }

      function onscrollFn() {
        if (more.getBoundingClientRect().top <= vpHeight) {
          onloadFn();
        }
      }

      function setHeadlines(response) {

        var headlines = JSON.parse(response).news;

        if (headlines.length === 0) {
          more.classList.add('hidden');
          return;
        }

        headlines.forEach(function(value, index, array) {

          var date  = value.published.substr(0,10);
          var title = value.title;

          var div = document.createElement('div');
          var dt  = document.createElement('dt');
          var dd  = document.createElement('dd');
          var br  = document.createElement('br');

          div.classList.add('item');

          dt.innerHTML = date;
          dd.innerHTML = title;

          div.appendChild(dt);
          div.appendChild(dd);
          div.appendChild(br);

          newsfeed.appendChild(div);
        });

        offset += limit;
      }

      function setQueryString (params) {

        var queries = Object.keys(params).map(function(key) {
          return [key, '=', params[key]].join('');
        });

        return "?" + queries.join('&');
      }
    })();
    </script>
  </body>
</html>
{'fraction_non_alphanumeric': 0.15838769024920554, 'fraction_numerical': 0.008195350393042315, 'mean_word_length': 2.1129619989588755, 'pattern_counts': {'":': 0, '<': 70, '<?xml version=': 0, '>': 68, 'https://': 3, 'lorem ipsum': 0, 'www.': 2, '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': '555098', 'n_tokens_mistral': 1846, 'n_tokens_neox': 1747, 'n_words': 336}