This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
MIT-LICENSE | Sun Jan 11 00:21:25 -0800 2009 | |
| |
README | Sun Jan 11 00:24:12 -0800 2009 | |
| |
Rakefile | Sun Jan 11 00:21:25 -0800 2009 | |
| |
init.rb | Sun Jan 11 00:21:25 -0800 2009 | |
| |
install.rb | Sun Jan 11 00:21:25 -0800 2009 | |
| |
lib/ | Mon Jan 12 20:42:22 -0800 2009 | |
| |
tasks/ | Sun Jan 11 00:21:25 -0800 2009 | |
| |
test/ | Sun Jan 11 14:00:29 -0800 2009 | |
| |
uninstall.rb | Sun Jan 11 00:21:25 -0800 2009 |
README
TinifyUrls
==========
A Rails plugin that makes it easy to convert long URLs to shorter ones using
popular services like TinyURL, SnipURL, and is.gd.
Uses TinyURL by default, but you can pass :snipurl or :is_gd to the Tinifier
constructor, or override the default in an initializer:
Tinifier.default_api = :snipurl
Example
=======
t = Tinifier.new # using TinyURL by default
# shorten a single URL
puts t.tinify_url('http://www.patientslikeme.com')
# or shorten every URL in a string
puts t.tinify_urls('Please visit http://www.patientslikeme.com to learn more.')
View helpers are also provided:
<%= link_to tinify_url('http://www.patientslikeme.com', :snipurl) %>
You can also pass a block to implement custom URL shortening logic. A
practical example is to cache URLs, avoiding extra expensive API invocations:
<%= link_to tinify_url('http://www.patientslikeme.com') { |url| UrlCache.for_full_url(url) } %>
Copyright (c) 2009 PatientsLikeMe, Inc., released under the MIT license







