Skip to content

Instantly share code, notes, and snippets.

@mikeymckay
Created April 25, 2013 21:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikeymckay/5463435 to your computer and use it in GitHub Desktop.
Save mikeymckay/5463435 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'sinatra'
require 'rest-client'
require 'cgi'
set :port, 9494
get '/' do
"<form action='/send'>
<input id='phone' name='phone' type='text'></input>
<input id='text' name='text' type='text'></input>
<input type='submit'></input>
</form>
"
end
get '/send' do
RestClient.get "http://127.0.0.1:9090/sendsms?phone=#{CGI.escape(params["phone"])}&text=#{CGI.escape(params["text"])}"
end
post '/log' do
puts params
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment