Class: Mush::Services::IsGd

Inherits:
Mush::Service show all
Defined in:
lib/mush/services/isgd.rb

Instance Method Summary collapse

Methods inherited from Mush::Service

#authorize, #get, #post

Instance Method Details

#shorten(url) ⇒ Object

Raises:



8
9
10
11
12
13
14
# File 'lib/mush/services/isgd.rb', line 8

def shorten(url)
  raise InvalidURI.new("Please provide a valid URI") if url.empty?
  
  options = {}
  options[:query] = {:longurl => url}
  get('/api.php', options).body.chomp
end