Skip to content

Instantly share code, notes, and snippets.

@robbyrussell
Created September 2, 2008 22:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robbyrussell/8483 to your computer and use it in GitHub Desktop.
Save robbyrussell/8483 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'httparty'
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
puts Rubyurl.shorten( 'http://istwitterdown.com/' ).inspect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment