<commit_before>require 'rubygems'
require 'twilio-ruby'
require 'sinatra'
require 'pry'

get '/sms-quickstart' do
  sender = params[:From]
  friends = {
   "+12243667047" => "Niraj"
  }
  name = friends[sender] || "Mobile Monkey"
  twiml = Twilio::TwiML::Response.new do |r|
    r.message "Hello, #{name}. Thanks for the message."
  end
  twiml.text
end<commit_msg>Send + Receive SMS<commit_after>require 'rubygems'
require 'twilio-ruby'
require 'sinatra'
require 'pry'

enable :sessions

account_sid = "<KEY>"
auth_token = "<PASSWORD>"
client = Twilio::REST::Client.new account_sid, auth_token

from = "+16304518767" # Your Twilio number

friends = {
"+12243667047" => "Niraj",
"+12246592659" => "Jarin"
}
friends.each do |key, value|
  client.account.messages.create(
    :from => from,
    :to => key,
    :body => "Hey #{value}, Monkey party at 6PM. Bring Bananas!"
  )
  puts "Sent message to #{value}"
end

get '/sms-quickstart' do
  session["counter"] ||=0
  sms_count = session["counter"]
  if sms_count == 0
    message = "Welcome! What is your name?"
  else
    message = "Hello, thanks for message number #{sms_count + 1}"
  end
  twiml = Twilio::TwiML::Response.new do |r|
    r.message message
  end
  session["counter"] += 1
  twiml.text
end
{'fraction_non_alphanumeric': 0.150597609561753, 'fraction_numerical': 0.03904382470119522, 'mean_word_length': 4.044176706827309, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '6111018', 'n_tokens_mistral': 497, 'n_tokens_neox': 462, 'n_words': 124}