Method: OwO::API.shorten

Defined in:
lib/owo/api.rb

.shorten(opts, url) ⇒ Object

Requests a url to be shortened



50
51
52
53
54
55
# File 'lib/owo/api.rb', line 50

def shorten(opts, url)
  request(
    :get,
    "#{opts['a']}#{SHORTEN_URL}?action=shorten&url=#{URI.escape(url)}&key=#{opts['t']}"
  ).sub(/awau\.moe/, opts['u'])
end