Sha256: 7192c0b095569ac17aab57e4424927ffe029c10abbf39d0e97752e0867222e01

Contents?: true

Size: 360 Bytes

Versions: 20

Compression:

Stored size: 360 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

20 entries across 20 versions & 4 rubygems

Version Path
alexvollmer-httparty-0.2.6 examples/rubyurl.rb
jnunemaker-httparty-0.2.0 examples/rubyurl.rb
jnunemaker-httparty-0.2.1 examples/rubyurl.rb
jnunemaker-httparty-0.2.2 examples/rubyurl.rb
jnunemaker-httparty-0.2.3 examples/rubyurl.rb
jnunemaker-httparty-0.2.4 examples/rubyurl.rb
jnunemaker-httparty-0.2.5 examples/rubyurl.rb
jnunemaker-httparty-0.2.6 examples/rubyurl.rb
jnunemaker-httparty-0.2.7 examples/rubyurl.rb
jnunemaker-httparty-0.2.8 examples/rubyurl.rb
juliocesar-httparty-0.2.6 examples/rubyurl.rb
httparty-0.2.1 examples/rubyurl.rb
httparty-0.2.0 examples/rubyurl.rb
httparty-0.2.2 examples/rubyurl.rb
httparty-0.2.3 examples/rubyurl.rb
httparty-0.2.4 examples/rubyurl.rb
httparty-0.2.8 examples/rubyurl.rb
httparty-0.2.5 examples/rubyurl.rb
httparty-0.2.6 examples/rubyurl.rb
httparty-0.2.7 examples/rubyurl.rb