-
-
Save x0x8x/668884c869a735e34f68b49dfc6d5677 to your computer and use it in GitHub Desktop.
geckoboard-node
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const gb = require('geckoboard')('api key'); [5/868] | |
gb.set('ping', function(err, res) { | |
if (err) { | |
console.error(err); | |
return; | |
} | |
gb.set('create', 'dwarf', { | |
fields: { | |
quantity: { | |
type: 'number', | |
name: 'Number of geckos' | |
}, | |
date: { | |
type: 'date', | |
name: 'Date' | |
} | |
} | |
}, function(err, res) { | |
if (err) { | |
console.error(err); | |
return; | |
} | |
gb.set('update', 'dwarf', { | |
data: [ | |
{ | |
quantity: 12, | |
date: '2016-07-07' | |
}, | |
{ | |
quantity: 15, | |
date: '2016-07-09' | |
}, | |
] | |
}, function (err) { | |
if (err) { | |
console.error(err); | |
return; | |
} | |
console.log('All is well'); | |
}) | |
}) | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const gb = require('geckoboard')('api key'); | |
gb.set('ping') | |
.then(res => gb.set('create', 'dwarf', { | |
fields: { | |
quantity: { | |
type: 'number', | |
name: 'Number of geckos' | |
}, | |
date: { | |
type: 'date', | |
name: 'Date' | |
} | |
} | |
})) | |
.then(res => gb.set('update', res.id, { | |
data: [ | |
{ | |
quantity: 12, | |
date: '2016-07-07' | |
}, | |
{ | |
quantity: 15, | |
date: '2016-07-09' | |
}, | |
] | |
})) | |
.then(res => console.log('All is well')) | |
.catch(err => console.log(err)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment