Skip to content

Instantly share code, notes, and snippets.

@luckydev
Created February 21, 2011 18:46
Show Gist options
  • Save luckydev/837501 to your computer and use it in GitHub Desktop.
Save luckydev/837501 to your computer and use it in GitHub Desktop.
GoShortener v1.2
> require "rubygems"
=> true
> require "goshortener"
=> true
> go = GoShortener.new("yourapikeyfromgoogle")
=> #<GoShortener:0x10056e6a8 @base_url="https://www.googleapis.com/urlshortener/v1/url", @api_key="yourapikeyfromgoogle">
> go.shorten("http://github.com/luckydev")
=> "http://goo.gl/TCZHi"
> go.lengthen("http://goo.gl/TCZHi")
=> "http://github.com/luckydev"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment