How to Troubleshoot Apps for the Modern Connected Worker
Twilio XHack 2012
1. How to use twilio from IRB (the REPL for Ruby)
$ irb
>> require 'twilio-rb'
>> Twilio::Config.setup :account_sid => 'ACxxxx...', :auth_token => 'xxxx...'
>> voiceurl = 'http://twimlbin.com/3323bb6b'
>> smsgreeting = 'Thanks for calling!'
>> puts 'Find and purchase a phone number ...'
>> Twilio::AvailablePhoneNumber.all :area_code => 415
>> _.first.purchase! :voice_url => voiceurl
>> puts 'Here is the number we bought, give it a call:'
>> n = _
>> n.friendly_name
>> puts 'Find send an SMS to everybody who called!'
>> calls = Twilio::Call.all :to => n.phone_number
>> calls.map {|f| Twilio::SMS.create :to => f.from, :from => n.phone_number,
:body => smsgreeting }