Path: | README |
Last Update: | Sun Oct 02 14:18:21 EDT 2005 |
ShortURL is a very simple library to use URL shortening services such as TinyURL or RubyURL.
ShortURL is available as a gem, installation is just like any other gem: $ gem install -r shorturl
You can also download the tar.bz2 archive at rubyforge.org/frs/?group_id=732 if you do not want to use the gem.
Here is the list of the services supported by ShortURL:
call-seq:
require "shorturl" puts ShortURL.shorten("http://mypage.com") puts ShortURL.shorten("http://mypage.com", :tinyurl)
The second parameter represents the service you want to use. These are:
You can use ShortURL.valid_services to obtain a list of the valid services (in case I forget to update the documentation)
You can also use the small script in bin/ which can be used from the command line: call-seq:
$ shorturl www.google.com http://rubyurl.com/fuuUw $ shorturl -s tinyurl www.google.com http://tinyurl.com/1c2 $
Vincent Foley