4 ms·
wanted this but didn't want to run another app when I'm already running SwiftBar--here is a version suitable for use with SwiftBar/xbar/etc. (error handling lef
by beaugunderson 2y ago
wanted this but didn't want to run another app when I'm already running SwiftBar--here is a version suitable for use with SwiftBar/xbar/etc. (error handling left as an exercise for the reader):
#!/usr/bin/env node
var Ls = require('lightstreamer-client-node');
var sub1 = new Ls.Subscription("MERGE",["NODE3000005"],["Value", "Status", "TimeStamp"]);
sub1.addListener({
onItemUpdate: function(obj) {
const percentage = obj.getValue('Value') + '%';
console.log(`${percentage} `);
process.exit(0);
}
});
var client = new Ls.LightstreamerClient("http://push.lightstreamer.com","ISSLIVE");
client.connect();
client.subscribe(sub1);