Created
February 7, 2012 03:11
Revisions
-
stefanobernardi revised this gist
Feb 7, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ require 'rubygems' require 'sinatra' # it's all about you # require 'stripe' -> stripe for payments require 'twilio-ruby' #-> twilio to send sms # require 'mail' -> with this I can send email # return some json stuff -
stefanobernardi revised this gist
Feb 7, 2012 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -19,4 +19,6 @@ :to => '+1xxxyyyxxxx', :body => params[:from] + " sent: " + params[:body] ) end # way more cool stuff over here -
stefanobernardi revised this gist
Feb 7, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ require 'rubygems' require 'sinatra' # it's all about you # require 'stripe' -> stripe for payments require 'twilio-ruby' -> twilio to send sms # require 'mail' -> with this I can send email # return some json stuff -
stefanobernardi revised this gist
Feb 7, 2012 . 1 changed file with 12 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -4,11 +4,19 @@ # require 'twilio-ruby' -> twilio to send sms # require 'mail' -> with this I can send email # return some json stuff get "/" do content_type :json # I do some pretty cool stuff here. cool_stuff.to_json end # receive a post request and send me an sms with the body of the request and the sender's number post "/stefano/sms" do @client = Twilio::REST::Client.new TWILIOSID, TWILIOTOKEN @client.account.sms.messages.create( :from => "+1xxxyyyzzzzz", :to => '+1xxxyyyxxxx', :body => params[:from] + " sent: " + params[:body] ) end -
stefanobernardi created this gist
Feb 7, 2012 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ require 'rubygems' require 'sinatra' # it's all about you # require 'stripe' -> stripe for payments # require 'twilio-ruby' -> twilio to send sms # require 'mail' -> with this I can send email get "/" do content_type :json #I do some pretty cool stuff here. cool_stuff.to_json end