Skip to content

Instantly share code, notes, and snippets.

@hongo35 hongo35/expand_url.rb
Last active Aug 29, 2015

Embed
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
You can’t perform that action at this time.