Acts As Tiny URL plugin

Plugin details

ActsAsTinyURL utilizes TinyURL's API to allow you to pass in any URL and have it generate a shortened URL on the fly.

Websitehttp://code.google.com/p/acts-as-tiny-url/ Repositoryhttp://acts-as-tiny-url.googlecode.com/svn/trunk/acts_as_tiny_url/ Author Brendan G. Lim Tags url LicenseMIT

Documentation

Install the plugin:
ruby script/plugin install http://acts-as-tiny-url.googlecode.com/svn/trunk/acts_as_tiny_url/

If you want one of your model's to be able to use ActsAsTinyURL, just add the following line right under the class declaration of one of your controllers.

include ActsAsTinyURL



Options
=======

The validate_uri option allows you to check, before trying to retrieve a URL, whether or not it is formatted correctly.


Example Usage
=============

tiny_url("http://brendanlim.com")


# returns http://tinyurl.com/3274fk

tiny_url("http://brendanlim.com", :validate_uri => true)


# returns true

tiny_url("http/brendanlim.com", :validate_uri => true)


# returns false

Further Documentation

There is currently no advanced documentation for this plugin.

New documentation

Edit plugin | Back in time (1 older version) | Last edited by: scott, 5 months ago