Sha256: 742794b32fc92a5ead68c07d84dfeaa7578122dd422eed0f713b57eb540137b2

Contents?: true

Size: 345 Bytes

Versions: 157

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

157 entries across 130 versions & 9 rubygems

Version Path
httparty-0.16.0 examples/rubyurl.rb
httparty-0.15.7 examples/rubyurl.rb
httparty-0.15.6 examples/rubyurl.rb
httparty-0.15.5 examples/rubyurl.rb
httparty-0.15.4 examples/rubyurl.rb
httparty-0.15.3 examples/rubyurl.rb
httparty-0.15.2 examples/rubyurl.rb
httparty-0.15.1 examples/rubyurl.rb
httparty-0.15.0 examples/rubyurl.rb
httparty-0.14.0 examples/rubyurl.rb
simplenet-client-0.2.0 ./vendor/bundle/ruby/1.9.1/gems/httparty-0.13.7/examples/rubyurl.rb
simplenet-client-0.2.0 ./vendor/bundle/ruby/2.0.0/gems/httparty-0.13.7/examples/rubyurl.rb
httparty-0.13.7 examples/rubyurl.rb
httparty-0.13.6 examples/rubyurl.rb
httpserious-0.13.5.lstoll1 examples/rubyurl.rb
httparty-0.13.5 examples/rubyurl.rb
httparty-0.13.4 examples/rubyurl.rb