Module: Butts

Defined in:
lib/butts.rb,
lib/butts/version.rb

Constant Summary collapse

VERSION =
'1.0.1'

Class Method Summary collapse

Class Method Details

.get_short_url(url) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/butts.rb', line 8

def self.get_short_url(url)
  options = { body: {url: url}.to_json }
  options[:headers] = @header

  shortcode = HTTParty.post("#{@butts_uri}/create", options)

  "http://butts.so/#{shortcode['shortcode']}"
end