<commit_before>var request = require('request');
var _ = require('underscore');
_.mixin( require('underscore.deferred') );
var Twit = require('twit');
var T = new Twit(require('./config.js'));
var wordfilter = require('wordfilter');
var ent = require('ent');
var wordnikKey = require('./permissions.js').key;

var getNounUrl = 'http://api.wordnik.com:80/v4/words.json/randomWord?hasDictionaryDef=true&includePartOfSpeech=noun&excludePartOfSpeech=noun-plural,noun-posessive,proper-noun,proper-noun-plural,proper-noun-posessive&minCorpusCount=100&minDictionaryCount=13&minLength=3&maxLength=8&api_key=' + wordnikKey;

Array.prototype.pick = function() {
  return this[Math.floor(Math.random()*this.length)];
};

fruits = ['berries', 'fruit'];

function tweetWord(word) {
    T.post('statuses/update', { status: word }, function(err, reply) {
        if (err) {
            console.log('error:', err);
        } else {
            console.log('tweet:', reply);
        }
    });
}

function tweetSnozz() {
    var noun = '',
        tweet = 'The ',
        fruitstring;
    //let's get some adjectives!
    request(getNounUrl, function(error, response, data) {
        // let's make sure we're dealing with JSON
        var nounData = JSON.parse(data);
        console.log(nounData);
        if (!error) {
            noun = nounData.word;
            // if we got back some data from the API and it didn't error
            if (!wordfilter.blacklisted(noun) && !(word[0] === word[0].toUpperCase())){
                console.log(noun);
                fruitstring = noun + fruits.pick();
                tweet += fruitstring + ' taste like ' + fruitstring +'!';
                console.log(tweet);
                tweetWord(tweet);
                return;
            } else {
                tweetSnozz();
            }
        }
    });
}

// // Tweet every 30 minutes
// setInterval(function () {
//     try {
//         tweetLegend();
//     }
//     catch (e) {
//         console.log(e);
//     }
// }, 1000 * 60 * 30);
<commit_msg>Fix bug, before pushing to prod.<commit_after>var request = require('request');
var _ = require('underscore');
_.mixin( require('underscore.deferred') );
var Twit = require('twit');
var T = new Twit(require('./config.js'));
var wordfilter = require('wordfilter');
var ent = require('ent');
var wordnikKey = require('./permissions.js').key;

var getNounUrl = 'http://api.wordnik.com:80/v4/words.json/randomWord?hasDictionaryDef=true&includePartOfSpeech=noun&excludePartOfSpeech=noun-plural,noun-posessive,proper-noun,proper-noun-plural,proper-noun-posessive&minCorpusCount=100&minDictionaryCount=13&minLength=3&maxLength=8&api_key=' + wordnikKey;

Array.prototype.pick = function() {
  return this[Math.floor(Math.random()*this.length)];
};

fruits = ['berries', 'fruit'];

function tweetWord(word) {
    T.post('statuses/update', { status: word }, function(err, reply) {
        if (err) {
            console.log('error:', err);
        } else {
            console.log('tweet:', reply);
        }
    });
}

function tweetSnozz() {
    var noun = '',
        tweet = 'The ',
        fruitstring;
    //let's get some adjectives!
    request(getNounUrl, function(error, response, data) {
        // let's make sure we're dealing with JSON
        var nounData = JSON.parse(data);
        console.log(nounData);
        if (!error) {
            noun = nounData.word;
            // if we got back some data from the API and it didn't error
            if (!wordfilter.blacklisted(noun) && !(noun[0] === noun[0].toUpperCase())){
                console.log(noun);
                fruitstring = noun + fruits.pick();
                tweet += fruitstring + ' taste like ' + fruitstring +'!';
                console.log(tweet);
                tweetWord(tweet);
                return;
            } else {
                tweetSnozz();
            }
        }
    });
}

// // Tweet every 30 minutes
// setInterval(function () {
//     try {
//         tweetLegend();
//     }
//     catch (e) {
//         console.log(e);
//     }
// }, 1000 * 60 * 30);

{'fraction_non_alphanumeric': 0.16043042308632918, 'fraction_numerical': 0.010760577158229395, 'mean_word_length': 2.382961124896609, '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': '1383090', 'n_tokens_mistral': 1357, 'n_tokens_neox': 1279, 'n_words': 249}