Class: MultiShorten::MtNy

Inherits:
UrlShortener show all
Defined in:
lib/multi_shorten/url_shorteners.rb

Overview

URL Shortener for mtny.mobi

Class Method Summary collapse

Methods inherited from UrlShortener

#fail

Class Method Details

.shorten(url) ⇒ Object



117
118
119
120
121
122
123
124
# File 'lib/multi_shorten/url_shorteners.rb', line 117

def self.shorten url
  response = get "/api", :query => {:type => "json", :source => "web", :url => URI.encode(url)}
  unless response.parsed_response["url"].nil?
    { :status => :success, :short_url => response.parsed_response["url"] }
  else
    fail
  end
end