Class: Bitly

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

Class Method Summary collapse

Class Method Details

.get_short_url(url) ⇒ Object



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

def self.get_short_url(url)
  options = { query:
              {
                access_token: '15a79b3bc8f0e040c1d1ffbe87d18f056f7403bb',
                longUrl: url,
                format: 'txt'
    }
  }

  HTTParty.get("#{@base_uri}/v3/shorten", options).strip
end