Last active
August 29, 2015 13:58
-
-
Save xmjw/9951471 to your computer and use it in GitHub Desktop.
Makers Twilio Stuff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'twilio-ruby' | |
client = Twilio::REST::Client.new "Your twilio SID", "Tour twilio Token" | |
#Send SMS... | |
client.account.messages.create(to: "+44 your number", from: "+44a twilio number", body: "the contents of your message") | |
#Make a call... | |
client.account.calls.create(to: "+44 your number", from: "+44a twilio number", url: "http://blahblah.ngrok.com/cheese") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sinatra' | |
post '/cheese' do | |
content_type 'text/xml' | |
"<Response> | |
<Say>Some crazy cheese joke. Now we'll play some music...</Say> | |
<Play>http://cdn.wawra.co/sw.mp3</Play> | |
</Response>" | |
end | |
post '/message' do | |
content_type 'text/xml' | |
"<Response> | |
<Message>This is your reply message!</Message> | |
</Response>" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment