Skip to content

Instantly share code, notes, and snippets.

@jbrechtel
Created April 9, 2009 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbrechtel/92494 to your computer and use it in GitHub Desktop.
Save jbrechtel/92494 to your computer and use it in GitHub Desktop.
require 'services/tinyurl'
require 'services/bitly'
require 'services/isgd'
require 'services/longurl'
services =
{
:tinyurl => TinyUrl.new,
:bitly => BitLy.new,
:isgd => IsGd.new,
:expand => LongUrl.new
}
default_service = :isgd
service = default_service
service = ARGV[1].to_sym unless ARGV[1].nil?
servicer = services[service]
puts servicer.shrink_url(ARGV[0])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment