<commit_before>'use strict';

var moment = require('moment');
var rp = require('request-promise');

var appId = process.env.TWILLIO_SID;
var pass = process.env.TWILLIO_AUTH_TOKEN;
var fromNumber = process.env.TWILLIO_PHONE_NUMBER;
var url = 'https://api.twilio.com/2010-04-01/Accounts/'+ appId +'/Messages.json';


function sendMessage (opts) {
  var date = moment(opts.eventDate).year(moment(Date.now()).year()).fromNow();
  var msg = opts.recipient +"'s " +
    opts.eventName + " is coming up " +
    date + ". Be the best part of the day with one of these ideas!";

  var options = {
    method: 'POST',
    uri: url,
    form: {
      "To": opts.toNumber,
      "From": fromNumber,
      "Body": msg
    },
    auth: {
      user: appId,
      password: <PASSWORD>
    }
  };

  rp(options)<commit_msg>Shell to invoke Twillio api upon client insert<commit_after>'use strict';

var moment = require('moment');
var rp = require('request-promise');

var appId = process.env.TWILLIO_SID;
var pass = process.env.TWILLIO_AUTH_TOKEN;
var fromNumber = process.env.TWILLIO_PHONE_NUMBER;
var toNumber = process.env.TWILLIO_TEST_NUMBER;
var url = 'https://api.twilio.com/2010-04-01/Accounts/'+ appId +'/Messages.json';


function sendMessage (opts) {
  var date = moment(opts.eventDate).year(moment(Date.now()).year()).fromNow();
  var msg = opts.recipient +"'s " +
    opts.eventName + " is coming up " +
    date + ". Be the best part of the day with one of these ideas!";

  var options = {
    method: 'POST',
    uri: url,
    form: {
      //"To": opts.toNumber,
      //FOR NOW WE ARE HARDCODING THE "TO" #:
      "To": toNumber,
      "From": fromNumber,
      "Body": msg
    },
    auth: {
      user: appId,
      password: <PASSWORD>
    }
  };

  rp(options)
{'fraction_non_alphanumeric': 0.1529745042492918, 'fraction_numerical': 0.009065155807365438, 'mean_word_length': 3.087962962962963, 'pattern_counts': {'":': 7, '<': 5, '<?xml version=': 0, '>': 5, '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': '2048445', 'n_tokens_mistral': 642, 'n_tokens_neox': 606, 'n_words': 154}