<commit_before>/*******************************************************************************
 * loklak-fetcher-client
 * 	by <NAME> (C) 2016 - Under MIT license
 * 	Bugs? Questions? Don't know what's the meaning of life?
 * 	Take a look at: github.com/YagoGG/loklak-fetcher-client
 *  Please, keep this header if you want to use this code. Thank you ;)
 ******************************************************************************/

window.loklakFetcher = (function() {
  var script = null;

  var loklakFetcher = {
    /**
     * Fetches tweets from the public loklak API, with the options provided
     * @param  {string}   query    Query string, see loklak.org/api.html
     * @param  {object}   options  Object with allowed GET-attributes, see
     *                             loklak.org/api.html
     * @param  {function} callback Function called after getting the results.
     *                             These are passed as first argument
     */
    getTweets: function(query, options, callback) {
      if(typeof options === 'function') { // A callback has been provided as 2nd
                                          // argument (no options)
        var callback = options;
        options = {};
      } else if(callback === undefined) { // No callback has been provided, even
                                          // as 2nd argument
        throw new Error('[LOKLAK-FETCHER] No callback provided');
      }

      var settings = [ 'count', 'source', 'fields', 'limit', 'tzOffset',
        'minified' ];  // Field names for all the possible parameters
      var defaults = [ 100, 'cache', '', '', 0, true ];  // Default values

      // Check if no options have been provided
      if(typeof options === 'undefined') {
        var options = {}; // Create 'options' to avoid ReferenceErrors later
      }

      // Write unset options as their default
      for(index in settings) {
        if(options[settings[index]] === undefined) {
          options[settings[index]] = defaults[index];<commit_msg>Fix JavaScript lint<commit_after>/*******************************************************************************
 * loklak-fetcher-client
 * 	by <NAME> (C) 2016 - Under MIT license
 * 	Bugs? Questions? Don't know what's the meaning of life?
 * 	Take a look at: github.com/YagoGG/loklak-fetcher-client
 *  Please, keep this header if you want to use this code. Thank you ;)
 ******************************************************************************/

window.loklakFetcher = (function() {
  var script = null;

  var loklakFetcher = {
    /**
     * Fetches tweets from the public loklak API, with the options provided
     * @param  {string}   query    Query string, see loklak.org/api.html
     * @param  {object}   options  Object with allowed GET-attributes, see
     *                             loklak.org/api.html
     * @param  {function} callback Function called after getting the results.
     *                             These are passed as first argument
     */
    getTweets: function(query, options, callback) {
      if(typeof options === 'function') { // A callback has been provided as 2nd
                                          // argument (no options)
        callback = options;
        options = {};
      } else if(callback === undefined) { // No callback has been provided, even
                                          // as 2nd argument
        throw new Error('[LOKLAK-FETCHER] No callback provided');
      }

      var settings = [ 'count', 'source', 'fields', 'limit', 'tzOffset',
        'minified' ];  // Field names for all the possible parameters
      var defaults = [ 100, 'cache', '', '', 0, true ];  // Default values

      // Check if no options have been provided
      if(typeof options === 'undefined') {
        options = {}; // Create 'options' to avoid ReferenceErrors later
      }

      // Write unset options as their default
      for(var index in settings) {
        if(options[settings[index]] === undefined) {
          options[settings[index]] = defaults[index];
{'fraction_non_alphanumeric': 0.17710902812037493, 'fraction_numerical': 0.00493339911198816, 'mean_word_length': 2.3292282430213467, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '197865', 'n_tokens_mistral': 1059, 'n_tokens_neox': 1010, 'n_words': 356}