<commit_before>module.exports = {
    getHttpRequestData : function(url){
        var request = require('request');
        var fs = require('fs');
        var all = [];

        request(url, function (error, response, body) {

            if (!error && response.statusCode == 200) {
                var data = JSON.parse(body);

                fs.appendFile((__tmpbase+"rarePokemon/rarePokemon_"+parseInt(Math.floor(Date.now() / 1000))+".json").toString(), JSON.stringify(data.results), function(err) {
                    if(err) {
                        return console.log(err);
                    }
                    console.log("The file was saved!");
                });
            }
        });
    }
};<commit_msg>strict variavble checking and making  the service more generalized to be used for other Pokemon listener sources<commit_after>"use strict";
module.exports = {
    getHttpRequestData : function(url){
        let request = require('request'),
            fs = require('fs'),
            all = [];

        request(url, function (error, response, body) {

            if (!error && response.statusCode === 200) {
                const data = JSON.parse(body),
                      srcName = process.env.npm_config_collection,
                      fileName = (__tmpbase+srcName+"/"+srcName+"_"+parseInt(Math.floor(Date.now() / 1000))+".json").toString();

                fs.appendFile(fileName, JSON.stringify(data.results), function(err) {
                    if(err) {
                        return console.log(err);
                    }
                    console.log("The file was saved!");
                });
            }
        });
    }
};
{'fraction_non_alphanumeric': 0.13519952352590828, 'fraction_numerical': 0.008338296605122097, 'mean_word_length': 1.6751592356687899, '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': '7336532', 'n_tokens_mistral': 455, 'n_tokens_neox': 420, 'n_words': 88}