Readme
Googl
Google URL Shortener API in Ruby
Basic Usage
Shorten a long URL
Google URL Shortener API in Ruby
url = Googl.shorten('http://www.zigotto.com') url.short_url => "http://goo.gl/ump4s" url.long_url => "http://www.zigotto.com/" url.qr_code => "http://goo.gl/ump4s.qr"
Expand a short URL
url = Googl.expand('http://goo.gl/ump4S') url.long_url => "http://www.zigotto.com/"
Authentication
The Google URL Shortener API supports the OAuth and ClientLogin mechanisms for authenticating. For shorten requests, each short URL for an authenticated user is unique, and thus will gather unique click statistics. In addition, it shows up on the user’s dashboard at goo.gl.
ClientLogin
client = Googl.client('user@gmail.com', 'my_valid_password') url = client.shorten('https://github.com/zigotto/googl') url.short_url => http://goo.gl/DWDfi
Go to goo.gl to see URL statistics.
OAuth
TODO
Installation
gem install googl
License
MIT License. Copyright 2011 Zigotto®. www.zigotto.com.br