based on acts_as_tiny_url by Brendan G. Lim ([email protected])
ActsAsBitlyURL utilizes Bit.ly’s API to allow you to pass in any URL and have it generate a shortened URL on the fly.
By default you can use the +bitly_url()+ method in all your controllers, views and models.
The :validate_uri
option allows you to check, before trying to retrieve a URL, whether or not it is formatted correctly.
bitly_url("http://google.com") # returns http://bit.ly/da7vQs bitly_url("http://brendanlim.com", :validate_uri => true) # returns true bitly_url("http/brendanlim.com", :validate_uri => true) # returns false
Copyright © 2008 Max Schulze ([email protected]), released under the MIT license