<commit_before>// エラー処理は終了にしているのでforeverなどでプロセス監視してください
var keyword = process.env.keyword
var device =  process.env.PushBullet_device
var PushBullet = require('pushbullet');
var pusher = new PushBullet(process.env.PushBullet_Access_Token);
var twitter = require('ntwitter');
var twit = new twitter({
  consumer_key: process.env.twitter_consumer_key,
  consumer_secret: process.env.twitter_consumer_secret,
  access_token_key: process.env.twitter_access_token_key,
  access_token_secret: process.env.twitter_access_token_secret
});

twit.stream('user',  function(stream) {
  stream.on('data', function (data) {
    if (data && data.user && data.text.search(keyword)!=-1) {
     pusher.link(device, data.user.name+"@"+data.user.screen_name+" : "+data.text, "https://twitter.com/"+data.user.screen_name+"/status/"+data.id_str, function(error, response) {
      if (error) {
        console.log('pushBullet disconnection error. exit.');
        process.exit(1);
      } else {
        console.log(data.user.name+"@"+data.user.screen_name+" : "+data.text);
      }
     });
    }
  });
  stream.on('end', function (response) {
    // Handle a disconnection
    console.log('twitter disconnection error. exit.');
    process.exit(1);
  });
  stream.on('destroy', function (response) {
    // Handle a 'silent' disconnection from Twitter, no end/error event fired
    console.log('twitter disconnection error?(no end/error event fired) exit.');
    process.exit(1);
  });
});<commit_msg>Update app.js<commit_after>// エラー処理は終了にしているのでforeverなどでプロセス監視してください
var keyword = process.env.keyword
var device =  process.env.PushBullet_device
var PushBullet = require('pushbullet');
var pusher = new PushBullet(process.env.PushBullet_Access_Token);
var twitter = require('twitter');
var twit = new twitter({
  consumer_key: process.env.twitter_consumer_key,
  consumer_secret: process.env.twitter_consumer_secret,
  access_token_key: process.env.twitter_access_token_key,
  access_token_secret: process.env.twitter_access_token_secret
});

twit.stream('user',  function(stream) {
  stream.on('data', function (data) {
    if (data && data.user && data.text.search(keyword)!=-1) {
     pusher.link(device, data.user.name+"@"+data.user.screen_name+" : "+data.text, "https://twitter.com/"+data.user.screen_name+"/status/"+data.id_str, function(error, response) {
      if (error) {
        console.log('pushBullet disconnection error. exit.');
        process.exit(1);
      } else {
        console.log(data.user.name+"@"+data.user.screen_name+" : "+data.text);
      }
     });
    }
  });
  stream.on('error', function (response) {
    // Handle a disconnection
    console.log('twitter error. exit.');
    process.exit(1);
  });
});
{'fraction_non_alphanumeric': 0.15500736377025037, 'fraction_numerical': 0.002577319587628866, 'mean_word_length': 4.204980842911877, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '5035038', 'n_tokens_mistral': 930, 'n_tokens_neox': 915, 'n_words': 153}