Class: ButtsSo

Inherits:
Object
  • Object
show all
Defined in:
lib/parvus/shorteners/butts_so.rb

Class Method Summary collapse

Class Method Details

.get_short_url(url) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/parvus/shorteners/butts_so.rb', line 5

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

  shortcode = HTTParty.post(@base_uri, options)

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