The Programming Butler

hacking life with a servants heart

Twelve (gauge)

Today I hacked together an easy to use gem for accessing the Gauges API.

When I started this morning 12-gauge was the first thing I thought, so I called the gem Twelve (silly I know).

I had fun figuring out the API (with a little help from Brandon) and then writing the gem using some of the proxy object and method missing stuff I was learning a few weeks ago.

Installation

gem install twelve

Usage

Get the client ready:

access_token = "abcd1234"
bfg = Twelve.new(access_token)

Request your Gauges info:

bfg.me

For me I got this back:

{"name"=>"Jonathan Hoyt", "urls"=>{"self"=>"https://secure.gaug.es/me", "gauges"=>"https://secure.gaug.es/gauges", "clients"=>"https://secure.gaug.es/clients"}, "id"=>"...", "last_name"=>"Hoyt", "first_name"=>"Jonathan", "email"=>"jonmagic@gmail.com"}

Next try these:

bfg.clients
bfg.gauges

More Documentation and Examples

Its a full-fledged client, so you can create, update, and delete gauges as well as see all the different types of information available on a gauge. See the docs on GitHub!

posted December 9, 2011 by Hoyt