<commit_before>// dependencies
// ------------

var f = require('util').format
  , fs = require('fs')
  , path = require('path')
  , Log = require('log')
  , Twitter = require('ntwitter')
  , hnsearch = require('hnsearch')
  , config = require('./config');

// configuration
// -------------

var rTwitter = new Twitter({
      consumer_key: config.consumerKey
    , consumer_secret: config.consumerSecret
    , access_token_key: config.readAccessTokenKey
    , access_token_secret: config.readAccessTokenSecret
    })
  , wTwitter = new Twitter({
      consumer_key: config.consumerKey
    , consumer_secret: config.consumerSecret
    , access_token_key: config.writeAccessTokenKey
    , access_token_secret: config.writeAccessTokenSecret
    })
  , tweetFormat = [
      'Best guess:'
    , 'http://news.ycombinator.com/item?id=%s'
    , '/cc @%s'
    ].join(' ')
  , log = new Log(
      'info'
    , fs.createWriteStream( path.join(__dirname, 'log.log'), { flags: 'a' })
    );

// shs_linkbot
// -----------

log.info('launching @shs_linkbot');

getRepliedToTweetIds(function(err, repliedToTweetIds) {
  if (err) { return log.error('failed to get replied to tweets'); }

  getNewTweets(repliedToTweetIds, function(err, newTweets) {<commit_msg>Log to ENV.log.<commit_after>// dependencies
// ------------

var f = require('util').format
  , fs = require('fs')
  , path = require('path')
  , Log = require('log')
  , Twitter = require('ntwitter')
  , hnsearch = require('hnsearch')
  , config = require('./config');

// configuration
// -------------

var ENV = (process.env.NODE_ENV || 'dev').toLowerCase()
  , rTwitter = new Twitter({
      consumer_key: config.consumerKey
    , consumer_secret: config.consumerSecret
    , access_token_key: config.readAccessTokenKey
    , access_token_secret: config.readAccessTokenSecret
    })
  , wTwitter = new Twitter({
      consumer_key: config.consumerKey
    , consumer_secret: config.consumerSecret
    , access_token_key: config.writeAccessTokenKey
    , access_token_secret: config.writeAccessTokenSecret
    })
  , tweetFormat = [
      'Best guess:'
    , 'http://news.ycombinator.com/item?id=%s'
    , '/cc @%s'
    ].join(' ')
  , logPath = path.join(__dirname, f('%s.log', ENV))
  , log = new Log('info', fs.createWriteStream(logPath, { flags: 'a' }));

// shs_linkbot
// -----------

log.info('launching @shs_linkbot');

getRepliedToTweetIds(function(err, repliedToTweetIds) {
  if (err) { return log.error('failed to get replied to tweets'); }

  getNewTweets(repliedToTweetIds, function(err, newTweets) {
{'fraction_non_alphanumeric': 0.1727095516569201, 'fraction_numerical': 0.0, 'mean_word_length': 3.283806343906511, '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': '3531856', 'n_tokens_mistral': 849, 'n_tokens_neox': 833, 'n_words': 154}