<commit_before>var RECORD_URL = "http://localhost:1212/record?start=-10&duration=35";
var TWITTER_USERNAME = "goalflash";

var twitter = require('twitter')
  , humanize = require('humanize')
  , request = require('request');

var twit = new twitter(require('./config/twitter'));

console.log(humanize.date("Y-m-d H:i:s")+" Connecting to the Twitter Stream for @"+TWITTER_USERNAME);
twit.stream('user', {track:TWITTER_USERNAME}, function(stream) {
    console.log(humanize.date("Y-m-d H:i:s")+" Connected");
    stream.on('data', function(data) {
      if(!data.text) return;       
      if(data.user.screen_name != TWITTER_USERNAME) return;
      console.log("DATA: ", data);
      request(RECORD_URL);
    });

    stream.on('error', function(error) {
      console.error("Error in the twitter stream: ", error);
      process.exit(1);
    });

    stream.on('end', function(error) {
      console.error("Twitter stream ended - exiting");
      process.exit(1);
    });
});<commit_msg>Twitter logging<commit_after>var RECORD_URL = "http://localhost:1212/record?start=-10&duration=35";
var TWITTER_USERNAME = "GoalFlash";

var twitter = require('twitter')
  , humanize = require('humanize')
  , request = require('request');

var twit = new twitter(require('./config/twitter'));

console.log(humanize.date("Y-m-d H:i:s")+" Connecting to the Twitter Stream for @"+TWITTER_USERNAME);
twit.stream('user', {track:TWITTER_USERNAME}, function(stream) {
    console.log(humanize.date("Y-m-d H:i:s")+" Connected");
    stream.on('data', function(data) {
      console.log(humanize.date("Y-m-d H:i:s")+" DATA: ", data);
      if(!data.text) return;       
      if(data.user.screen_name != TWITTER_USERNAME) return;
      request(RECORD_URL);
    });

    stream.on('error', function(error) {
      console.error("Error in the twitter stream: ", error);
      process.exit(1);
    });

    stream.on('end', function(error) {
      console.error("Twitter stream ended - exiting");
      process.exit(1);
    });
});
{'fraction_non_alphanumeric': 0.18245264207377868, 'fraction_numerical': 0.009970089730807577, 'mean_word_length': 4.00498753117207, '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': '2787274', 'n_tokens_mistral': 699, 'n_tokens_neox': 663, 'n_words': 119}