Class: Shortie::Shorteners::Lns

Inherits:
BaseShortener show all
Defined in:
lib/shortie/shorteners/lns.rb

Instance Attribute Summary

Attributes inherited from BaseShortener

#url

Instance Method Summary collapse

Methods inherited from BaseShortener

#initialize, shorten

Constructor Details

This class inherits a constructor from Shortie::BaseShortener

Instance Method Details

#shortenObject



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/shortie/shorteners/lns.rb', line 4

def shorten
  ret = SimpleHttp.post("http://ln-s.net/home/api.jsp", {
    "url" => url
  })
  status, message = ret.split(/ /, 2)
  message.chomp!
  
  raise message unless status == "200"
  
  message
end