Class: MultiShorten::QrCx

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

Overview

URL Shortener for qr.cx

Class Method Summary collapse

Methods inherited from UrlShortener

#fail

Class Method Details

.shorten(url) ⇒ Object



132
133
134
135
136
137
138
139
# File 'lib/multi_shorten/url_shorteners.rb', line 132

def self.shorten url
  response = get "/api/?", :query => {:longurl => URI.encode(url)}
  if response.match("^http://qr.cx/.+")
    { :status => :success, :short_url => response.parsed_response }
  else
    fail
  end
end