Class: MultiShorten::JumboTweet

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

Overview

URL Shortener for Jumbo Tweet

Class Method Summary (collapse)

Methods inherited from UrlShortener

#fail

Class Method Details

+ (Object) shorten(url)



89
90
91
92
93
94
95
96
# File 'lib/multi_shorten/url_shorteners.rb', line 89

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