Skip to content

Instantly share code, notes, and snippets.

@maddenpj
Last active December 28, 2015 06:09
Show Gist options
  • Save maddenpj/7455455 to your computer and use it in GitHub Desktop.
Save maddenpj/7455455 to your computer and use it in GitHub Desktop.
var client = new TempoDBClient('api-key', 'api-secret')
var cb = function(result,err){
console.log(result)
}
var time = new Date('2013-11-07');
client.write_key('São Paulo', [{t: time, v: 12.34}], cb)
setTimeout(function() {
client.read_key('São Paulo', new Date('2013-11-07'), new Date('2013-11-08'), {}, cb)
}, 2000)
{ response: 200, body: '' } //The write
{ response: 200, //The read
body:
{ series:
{ id: 'e61390b2cf0b47688c2d54af7ff742b4',
key: 'São Paulo',
name: '',
tags: [],
attributes: {} },
start: '2013-11-07T00:00:00.000Z',
end: '2013-11-08T00:00:00.000Z',
data: [ [Object] ],
rollup: null,
summary:
{ sum: 12.34,
mean: 12.34,
max: 12.34,
min: 12.34,
stddev: 0,
ss: 0,
count: 1 } } }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment