Class: MultiShorten::Shortr
- Inherits:
-
UrlShortener
- Object
- UrlShortener
- MultiShorten::Shortr
- Defined in:
- lib/multi_shorten/url_shorteners.rb
Overview
URL Shortener for shortr.info
Class Method Summary collapse
Methods inherited from UrlShortener
Class Method Details
.shorten(url) ⇒ Object
147 148 149 150 151 152 153 154 |
# File 'lib/multi_shorten/url_shorteners.rb', line 147 def self.shorten url response = get "/make-shortr.php", :query => {:format => "json", :url => URI.encode(url)} unless response.parsed_response["shortr"]["result"]["created"].nil? { :status => :success, :short_url => response.parsed_response["shortr"]["result"]["created"] } else fail end end |