Skip to content

Instantly share code, notes, and snippets.

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

What would you like to do?
require 'uri'
require 'net/http'
url = ""
uri = URI.parse(url)
expanded_uri =, 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.