<commit_before>var api = require('request').defaults({
  json: true,
  headers: { 'Accept': 'application/vnd.heroku+json;' }
});

var colors = require('colors');
var timeago = require('timeago');
var dateFormat = require('dateformat');

function capitalize(str) {
  return str.substr(0, 1).toUpperCase() + str.substr(1);
}

function printStatus(status) {
  var message = capitalize(status);
  var color = colors[status];

  if (status === 'green') {
    message =  'No known issues at this time.';
  }
  return (color(message));
}

module.exports = {
  topic: '_status',
  description: 'Display current status of Heroku Platform',
  help: 'Example: heroku _status',
  needsAuth: false,
  run: function (context) {

    api = api.defaults({auth: context.auth});
    api.get({
      uri: 'https://status.heroku.com/api/v3/current-status/',
      json: true
    }, function (err, _, response) {
      if (err) { throw err; }
      console.log('=== Heroku Status');
      console.log('Development: %s', printStatus(response.status.Development));
      console.log('Production: %s', printStatus(response.status.Production));

      response.issues.forEach(function(incident) {
        console.log('\n=== %s %s (%s)', incident.title, dateFormat(incident.created_at, "UTC:h:MM:ss TT Z"), incident.full_url);

        incident.updates.forEach(function(update) {
          console.log('%s (%s) [%s] %s\n', dateFormat(incident.created_at, "UTC:h:MM:ss TT Z"), timeago(update.updated_at), capitalize(update.update_type), update.contents)
        });
      });
    });
  }
}<commit_msg>Uses iojs<commit_after>var api = require('request').defaults({
  json: true,
  headers: { 'Accept': 'application/vnd.heroku+json;' }
});

var colors = require('colors');
var timeago = require('timeago');
var dateFormat = require('dateformat');

function capitalize(str) {
  return str.substr(0, 1).toUpperCase() + str.substr(1);
}

function printStatus(status) {
  var message = capitalize(status);
  var color = colors[status];

  if (status === 'green') {
    message =  'No known issues at this time.';
  }
  return (color(message));
}

module.exports = {
  topic: '_status',
  description: 'Display current status of Heroku Platform',
  help: 'Example: heroku _status',
  needsAuth: false,
  run: function (context) {

    api = api.defaults({auth: context.auth});
    api.get({
      uri: 'https://status.heroku.com/api/v3/current-status/',
      json: true
    }, function (err, _, response) {
      if (err) { throw err; }
      console.log('=== Heroku Status');
      console.log(`Development: ${printStatus(response.status.Development)}`);
      console.log(`Production: ${printStatus(response.status.Production)}`);

      response.issues.forEach(function(incident) {
        console.log(`\n=== ${incident.title} ${dateFormat(incident.created_at, "UTC:h:MM:ss TT Z")} (${incident.full_url})`);

        incident.updates.forEach(function(update) {
          console.log(`[${capitalize(update.update_type)}] ${dateFormat(incident.created_at, "UTC:h:MM:ss TT Z")} (${timeago(update.updated_at)}) \n${update.contents}\n `)
        });
      });
    });
  }
}
{'fraction_non_alphanumeric': 0.17845761631612492, 'fraction_numerical': 0.0025493945188017845, 'mean_word_length': 3.8970358814352575, '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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2003118', 'n_tokens_mistral': 1037, 'n_tokens_neox': 1007, 'n_words': 210}