Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
require 'uri'
require 'net/http'
url = "http://amzn.to/hoge"
uri = URI.parse(url)
expanded_uri = Net::HTTP.new(uri.host, uri.port).get(uri.path).header['location']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment