1. Install the gem:
$ gem install stathat
2. Put it in your code:
#!/usr/bin/env ruby

require 'rubygems'
require 'stathat'
3. Make calls to StatHat. You do not need to create the stats first using the web interface.
StatHat::API.ez_post_value("load average", "YOUR_EZKEY", 0.92)
StatHat::API.ez_post_count("messages sent - female to male", "YOUR_EZKEY", 13)

Note: the default StatHat::API Ruby methods are asynchronous. If you are using this gem in a script that is short-lived, you can use StatHat::SyncAPI to make synchronous calls to StatHat.


© 2011-2017 Numerotron Inc