Created
July 9, 2009 20:27
-
-
Save cored/143971 to your computer and use it in GitHub Desktop.
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 'rubygems' | |
require 'sinatra' | |
require 'open-uri' | |
get '/' do | |
erb :index | |
end | |
get '/render' do | |
unless /^http:/ =~ params['url'] | |
url = "http://" | |
else | |
url = "" | |
end | |
url += params['url'] | |
open(url, "User-Agent" => "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment