README

Path: README
Last Update: Sun Jun 05 15:37:02 EDT 2005

ShortURL

Summary

ShortURL is a very simple library to use URL shortening services such as TinyURL or RubyURL.

Installation

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.

Usage:

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:

  • :rubyurl
  • :tinyurl
  • :snorl
  • :snipurl
  • :metamark
  • :makeashorterlink
  • :skinnylink
  • :linktrim
  • :shorterlink

Note that you can use ShortURL.valid_services to obtain a list of the valid services (in case I forget to update the documentation)

Thanks

  • Marcel Molina Jr., Devin Mullins for some ideas
  • imperator from ruby-lang (don’t know your real name, sorry) for helping me with creating and uploading a RubyGem

Author

Vincent Foley

[Validate]