Skip to content

Instantly share code, notes, and snippets.

@jkriss
Created March 9, 2010 18:44
Show Gist options
  • Save jkriss/326929 to your computer and use it in GitHub Desktop.
Save jkriss/326929 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'sinatra'
require 'twilio'
Twilio.connect(ENV['TWILIO_ACCOUNT_SID'], ENV['TWILIO_AUTH_TOKEN'])
RECORDINGS = %w{
http://mp3.com/1
http://mp3.com/2
http://mp3.com/3
http://mp3.com/4
}
post '/voice' do
verb = Twilio::Verb.play RECORDINGS[rand(RECORDINGS.size-1)]
verb.response
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment