Skip to content

Instantly share code, notes, and snippets.

@shaundon
Created March 6, 2014 12:34
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 shaundon/9388612 to your computer and use it in GitHub Desktop.
Save shaundon/9388612 to your computer and use it in GitHub Desktop.
Takes a POST request, and opens a webpage.
require 'sinatra'
require 'launchy'
set :port, 7428
post '/webpage' do
begin
Launchy.open(params[:url])
rescue
print 'Failed :('
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment