Googlus is a Ruby wrapper around Google URL Shortener REST API.

I often use URL shortener services and I was like “It would be cool if I could use it in Textmate, in my Ruby code or on the command-line!” so I wrote this thin lib to be able to do that.

Features

  • shorten URLs
  • expand URLs
  • analyse URLs usage

Installation

$ gem install googlus

Usage

In your Ruby code:

require 'rubygems'
require 'googlus'

Googlus::Shorten.new(long_url).short_url
Googlus::Expand.new(short_url).url
Googlus::Analytic.new(url).to_s

On the command-line:

$ googlus -s http://www.bounga.org # Shorten URL
$ googlus -e http://goo.gl/arOIJ   # Expand short URL
$ googlus -a http://goo.gl/arOIJ   # Get analytics for short URL

Other

If you want to contribute you should take a look at:

Source can be cloned using Mercurial on my Bitbucket repo.

Problems, comments, and suggestions are welcome on the tracker.

This gem is released under the MIT license.

Have comments or want to discuss this topic?

Send an email to ~bounga/public-inbox@lists.sr.ht