Sha256: 8715f69739d2dc4c7fa705f33a36bb75dcef425db2b245323a010dbcd261a241

Contents?: true

Size: 358 Bytes

Versions: 136

Compression:

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

136 entries across 135 versions & 28 rubygems

Version Path
alloy_sdk-0.1.0 vendor/bundle/ruby/3.0.0/gems/httparty-0.13.1/examples/rubyurl.rb
alloy_sdk-0.1.0 vendor/bundle/ruby/2.6.0/gems/httparty-0.13.1/examples/rubyurl.rb
allegro_api_client-0.0.9 gems/ruby/2.1.0/gems/httparty-0.13.1/examples/rubyurl.rb
allegro_api_client-0.0.8 gems/ruby/2.1.0/gems/httparty-0.13.1/examples/rubyurl.rb
allegro_api_client-0.0.7 gems/ruby/2.1.0/gems/httparty-0.13.1/examples/rubyurl.rb
asana2flowdock-1.0.0 vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/examples/rubyurl.rb
allegro_api_client-0.0.6 gems/ruby/2.1.0/gems/httparty-0.13.1/examples/rubyurl.rb
allegro_api_client-0.0.5 gems/ruby/2.1.0/gems/httparty-0.13.1/examples/rubyurl.rb
allegro_api_client-0.0.4 gems/ruby/2.1.0/gems/httparty-0.13.1/examples/rubyurl.rb
allegro_api_client-0.0.3 gems/ruby/2.1.0/gems/httparty-0.13.1/examples/rubyurl.rb
allegro_api_client-0.0.2 gems/ruby/2.1.0/gems/httparty-0.13.1/examples/rubyurl.rb
allegro_api_client-0.0.1 gems/ruby/2.1.0/gems/httparty-0.13.1/examples/rubyurl.rb
alexvollmer-httparty-0.3.1 examples/rubyurl.rb
alexvollmer-httparty-0.4.3 examples/rubyurl.rb
cluon-httparty-0.4.3 examples/rubyurl.rb
dbalatero-httparty-0.4.4 examples/rubyurl.rb
ddollar-httparty-0.4.6 examples/rubyurl.rb
geetarista-httparty-0.4.5 examples/rubyurl.rb
jcinnamond-httparty-0.4.5 examples/rubyurl.rb
jcinnamond-httparty-0.4.6 examples/rubyurl.rb