Sha256: 742794b32fc92a5ead68c07d84dfeaa7578122dd422eed0f713b57eb540137b2

Contents?: true

Size: 345 Bytes

Versions: 155

Compression:

Stored size: 345 Bytes

Contents

dir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
require File.join(dir, 'httparty')
require 'pp'

class Rubyurl
  include HTTParty
  base_uri 'rubyurl.com'

  def self.shorten(website_url)
    post('/api/links.json', query: { link: { website_url: website_url } })
  end
end

pp Rubyurl.shorten('http://istwitterdown.com/')

Version data entries

155 entries across 129 versions & 8 rubygems

Version Path
harbr-0.1.79 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/rubyurl.rb
harbr-0.1.78 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/rubyurl.rb
harbr-0.1.77 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/rubyurl.rb
harbr-0.1.76 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/rubyurl.rb
harbr-0.1.75 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/rubyurl.rb
harbr-0.1.74 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/rubyurl.rb
harbr-0.1.73 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/rubyurl.rb
harbr-0.1.72 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/rubyurl.rb
harbr-0.1.71 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/rubyurl.rb
harbr-0.1.70 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/rubyurl.rb
harbr-0.1.69 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/rubyurl.rb
harbr-0.1.68 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/rubyurl.rb
harbr-0.1.67 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/rubyurl.rb
harbr-0.1.66 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/rubyurl.rb
harbr-0.1.65 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/rubyurl.rb
harbr-0.1.64 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/rubyurl.rb
harbr-0.1.63 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/rubyurl.rb
harbr-0.1.62 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/rubyurl.rb
harbr-0.1.61 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/rubyurl.rb
harbr-0.1.60 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/rubyurl.rb