URL: http://bcmoney-mobiletv.com/blog/2009/05/01/the-server-side-proxy/
Useful resources: https://github.com/yuiseki/chaos_proxy/blob/master/proxy.rb
http://stackoverflow.com/questions/3072682/jquery-consuming-json-resources-some-return-data-others-dont-why
http://www.java-samples.com/showtutorial.php?tutorialid=1118
http://stackoverflow.com/questions/2500462/how-to-extract-url-parameters-from-a-url-with-ruby-or-rails
http://guides.rubyonrails.org/command_line.html
http://ruby-doc.org/core/classes/String.html#M000839
http://rails.nuvvo.com/lesson/6371-action-controller-parameters
http://www.ruby-doc.org/stdlib/libdoc/net/http/rdoc/classes/Net/HTTP.html
http://net.tutsplus.com/tutorials/ruby/ruby-for-newbies-conditional-statements-and-loops/
http://dirk.net/2009/09/16/globalizing-the-current-url-in-a-rails-view/
require 'net/http' require 'cgi' require 'uri' u = request.env['PATH_INFO'] if u == "" then u = ARGV[1]; end if u == "" then u = "http://example.com/?url=http://flickr.com/&f=text/plain&e=utf-8"; end link = URI.parse(uri) params = CGI::parse(link.query) url = params[:url] format = params[:f] encoding = params[:e] if url == "" then url = "http://example.com"; end if format == "" then format = "text/plain"; end if encoding == "" then encoding = "utf-8"; end response = Net::HTTP.get_response() p response['content-type'] put response.body
You need to login to post a comment.
