geckoboard-push
Version:
Send data to Geckoboard via their new push API
30 lines (22 loc) • 826 B
JavaScript
var Base = require('./GeckoboardPushSend');
module.exports = GeckoboardPushRag;
function GeckoboardPushRag(params,widget_key){
this.options = params;
this.options.widget_key = widget_key;
this.prototype = new Base(this.options);
}
GeckoboardPushRag.prototype.send = function(items, type, callback){
/*
https://developer.geckoboard.com/?_ga=1.151389241.124617393.1422374534#rag
items needs to be an array of 3 objects
each object needs a value and text and prefix (optional '€','£' or '$' for currency), first is RED, second is Amber, third is Green
if the value is blank, the corresponding indicator won’t be displayed. Description is a max 40 characters.
*/
var data = {
item: items
};
if (type) {
data.type = type;
}
this.prototype.send(data, callback);
}