<commit_before>var getJson = require('load-json');
var BASE_URL = 'http://kickasstorrents.im';

/**
 * {String|Object} query string or options f.x {}
 * avaliable options are any url options that kickass.to accepts
 * f.x. {field:'seeders', order:'desc', q: 'test',page: 2}
 * http://kickass.to/json.php?q=test&field=seeders&order=desc&page=2
 */

module.exports = function(options, callback) {
    if (typeof options === 'string')
        options = {
            q: options
        };
    if (!options.q)
        return callback(new Error('Search term "q" must be defined'));
    var url = (options.url || BASE_URL) + '/json.php';
    getJson(url, options, function(e, response) {
        if (e)
            return callback(e);
        callback(null, response);
    });
};<commit_msg>changed url<commit_after>var getJson = require('load-json');
var URL = 'http://kat.cr';

/**
 * {String|Object} query string or options f.x {}
 * avaliable options are any url options that kickass.to accepts
 * f.x. {field:'seeders', order:'desc', q: 'test',page: 2}
 * http://kickass.to/json.php?q=test&field=seeders&order=desc&page=2
 */

module.exports = function(options, callback) {
    if (typeof options === 'string')
        options = {
            q: options
        };
    
    if (!options.q) return callback(new Error('Search term "q" must be defined'));
    
    var url = (options.url || URL) + '/json.php';
    
    getJson(url, options, function(e, response) {
        if (e) return callback(e);
        callback(null, response);
    });
};
{'fraction_non_alphanumeric': 0.1674237508111616, 'fraction_numerical': 0.0025957170668397143, 'mean_word_length': 3.005194805194805, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5781291', 'n_tokens_mistral': 500, 'n_tokens_neox': 492, 'n_words': 127}