<commit_before><!DOCTYPE html>
<html>
  <head>
    <!-- This code uses the jQuery library -->
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
    
    <script type="text/javascript">

      /* 
       * This function will execute when the Document Object Model (DOM) is
       * ready for JavaScript to execute.
       */
      $( document ).ready( function() {
        queryDplaApi();
      });

      function queryDplaApi() {
        // This is the base url for making calls to the DPLA API.
        var baseUrl = "http://api.dp.la/v2/items?";

        /*
         * These query opts will be appended to your base url as parameters.
         * You add or delete opts based on your needs for each query. The only
         * required opt is "api_key".  See the DPLA API codex for more
         * information: http://dp.la/info/developers/codex/requests/
         *
         * You should ideally store your api key in a separate, private file.
         */
        var queryOpts = { 
          "api_key": "your api key here", 
          "q": "dogs", 
          "sourceResource.type": "image",
          "fields": "id,object",
          "page_size": "50",
          "page": "1"
        };

        sendApiRequest( baseUrl, queryOpts );
      }

      /*
       * This function sends and AJAX query to the DPLA API.
       * 
       * Specifying the data type as JSONP allows you to make requests to the
       * DPLA API from a non-DPLA domain.  
       * However, $.ajax does not support error handling for cross domain JSONP
       * requests.  This means the 'error' function won't execute in the case of
       * 400, 404, and 500 errors, etc.
       * One workaround is to set a timeout to catch these otherwise silent
       * failures. A drawback of this method is that in the case of an error,
       * there will be a slight delay before the 'error' function executes.
       * An alternative workaround is the jquery-jsonp plugin, which uses
       * $.jsonp instead of $.ajax (see markb's example).
       */
      function sendApiRequest( baseUrl, queryOpts ) {
        $.ajax({
          url: baseUrl,
          data: queryOpts,
          dataType: "jsonp",
          timeout: 5000,
          success: function( data ) {
            // This function executes if the api request is successful.
            renderApiResponse( data );<commit_msg>Remove "jsonp" option from js-onepage<commit_after><!DOCTYPE html>
<html>
  <head>
    <!-- This code uses the jQuery library -->
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
    
    <script type="text/javascript">

      /* 
       * This function will execute when the Document Object Model (DOM) is
       * ready for JavaScript to execute.
       */
      $( document ).ready( function() {
        queryDplaApi();
      });

      function queryDplaApi() {
        // This is the base url for making calls to the DPLA API.
        var baseUrl = "http://api.dp.la/v2/items?";

        /*
         * These query opts will be appended to your base url as parameters.
         * You add or delete opts based on your needs for each query. The only
         * required opt is "api_key".  See the DPLA API codex for more
         * information: http://dp.la/info/developers/codex/requests/
         *
         * You should ideally store your api key in a separate, private file.
         */
        var queryOpts = { 
          "api_key": "your api key here", 
          "q": "dogs", 
          "sourceResource.type": "image",
          "fields": "id,object",
          "page_size": "50",
          "page": "1"
        };

        sendApiRequest( baseUrl, queryOpts );
      }

      /*
       * This function sends and AJAX query to the DPLA API.
       * 
       * Specifying the data type as JSONP allows you to make requests to the
       * DPLA API from a non-DPLA domain.  
       * However, $.ajax does not support error handling for cross domain JSONP
       * requests.  This means the 'error' function won't execute in the case of
       * 400, 404, and 500 errors, etc.
       * One workaround is to set a timeout to catch these otherwise silent
       * failures. A drawback of this method is that in the case of an error,
       * there will be a slight delay before the 'error' function executes.
       * An alternative workaround is the jquery-jsonp plugin, which uses
       * $.jsonp instead of $.ajax (see markb's example).
       */
      function sendApiRequest( baseUrl, queryOpts ) {
        $.ajax({
          url: baseUrl,
          data: queryOpts,
          timeout: 5000,
          success: function( data ) {
            // This function executes if the api request is successful.
            renderApiResponse( data );
{'fraction_non_alphanumeric': 0.09659920717713331, 'fraction_numerical': 0.008762779052785313, 'mean_word_length': 1.9447174447174447, 'pattern_counts': {'":': 12, '<': 17, '<?xml version=': 0, '>': 17, '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': '5072914', 'n_tokens_mistral': 1362, 'n_tokens_neox': 1279, 'n_words': 522}