Skip to content

Instantly share code, notes, and snippets.

@jonmarkgo
Created May 3, 2013 04:36
Show Gist options
  • Save jonmarkgo/5507234 to your computer and use it in GitHub Desktop.
Save jonmarkgo/5507234 to your computer and use it in GitHub Desktop.
post "/subcallback" do
reply_result = @client.execute(
:api_method => @glass.timeline.get,
:parameters => {"id" => @data["itemId"]},
:authorization => @client.authorization)
reply = reply_result.data.text
msg_result = @client.execute(
:api_method => @glass.timeline.get,
:parameters => {"id" => reply_result.data.inReplyTo},
:authorization => @client.authorization)
smsSid = msg_result.data.sourceItemId
sms = @twilio.account.sms.messages.get(smsSid)
@twilio.account.sms.messages.create(:from => @phone_number, :to => sms.from, :body => reply)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment