How to Decode TinyURLs with Ruby

def reverse_tinyurl(tinyurl)
  require 'open-uri'
  require 'net/http'

  url = Net::HTTP.get_response(URI.parse(tinyurl)).to_hash['location'].to_s

This should also work for any url that is a known redirect whether it be a,,, or what have you.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.