Skip to content
This repository
John Nunemaker
file 14 lines (11 sloc) 0.358 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14
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/')
Something went wrong with that request. Please try again.