var assert = require('assert'), restify = require('restify'), osc = require('node-osc'); var hubAddress = '192.168.23.43', hubPort = 7110; var oscClient = new osc.Client(hubAddress, hubPort); var streams = [ 91755, 70632, 53146, 45582 ]; var client = restify.createJsonClient({ url: 'http://api.cosm.com', headers: {'X-ApiKey':'orKBBdLAKuKJU-RxqmZpZB6q0baSAKxBTVhKdjhUNkdyVT0g'},version:'*' }); var recentvalues = {}; var getstream = function(streamId) { client.get('/v2/feeds/' + streamId + ".json", function(err, req, res, obj) { if(err == null && obj.datastreams != null) { for(var i=0;i 0) streamName = dataStream.tags[0] + streamName; var address = '/cosm/' + obj.id + "/" + streamName; var currentValue = dataStream.current_value; if(isNumber(currentValue)) currentValue = parseFloat(currentValue); if(recentvalues[address] != currentValue) { oscClient.send(address, currentValue); } recentvalues[address] = currentValue; } } } else { console.error("receive failure %s", err); } }); } setInterval(function() { for(var i=0;i