Skip to content

Instantly share code, notes, and snippets.

@trevorturk
Forked from reagent/expander.rb
Created September 1, 2009 18:12
Show Gist options
  • Save trevorturk/179263 to your computer and use it in GitHub Desktop.
Save trevorturk/179263 to your computer and use it in GitHub Desktop.
# how to follow bit.ly style urls to get at the real url
require 'rubygems'
require 'curb'
client = Curl::Easy.new('http://bit.ly/fleakr') do |config|
config.follow_location = true
config.max_redirects = 5
end
client.http_head
puts client.last_effective_url
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment