Twilio XHack 2012

353 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
353
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Twilio XHack 2012

  1. 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 }

×