Project

pachuber

0.0
No commit activity in last 3 years
No release in over 3 years
%q{Just a simple Ruby library to provides Ruby-style abstraction around the HTTP API at Pachube.}
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

First whack at a Ruby API for interacting with Pachube

Work in progress at this point

Requires version 0.2.0 or greater of the eeml-simple EEML wrapper library (not the eeml gem). Thanks to James Smith for including my changes upstream.

Take a peek at the test cases for examples of how to consume/contribute to Pachube in either EEML XML or EEML objects.

Wants

To support the whole API, I don’t need it all yet. So…if you’re interested fork away or let me know how I can help.

Using

require 'rubygems'
require 'pachuber'
require 'gotempr'
require 'position'

pos = Position.new

tmp = GoTempR::Fetcher.new("/dev/ldusb0").celcius

env = EEML::Environment.new
env.location = EEML::Location.new(:physical, :disposition => :mobile,   
  :exposure => :outdoor,
  :lat => pos.lat.to_f, :lon => pos.lng.to_f,
  :name => "Temp where Kit is")

data = EEML::Data.new(tmp)
data.tags << "temperature"
data.unit = EEML::Unit.new("Celsius", :symbol => 'C', :type => :derivedSI)
env << data

pach = Pachube.new(PACHUBE_KEY)
resp = pach.update("/4078.xml", env.to_eeml).code.to_s
puts "RESPONSE CODE: #{resp}"