Class: MultiShorten::Linkee

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

Overview

URL Shortener for Linkee

Class Method Summary collapse

Methods inherited from UrlShortener

#fail

Class Method Details

.shorten(url) ⇒ Object



47
48
49
50
51
52
53
54
# File 'lib/multi_shorten/url_shorteners.rb', line 47

def self.shorten url
  response = get "/1.0/shorten", :query => {:input => URI.encode(url)}
  if response["status"]["code"] == 200
    {:status => :success, :short_url => response["result"]}
  else
    {:status => :fail}
  end
end