From fd8f36768c4dee0ed6efb26b2985e6bf1d0a699f Mon Sep 17 00:00:00 2001 From: Lucas Date: Tue, 22 Jan 2013 13:59:56 +0100 Subject: [PATCH] bugfix in tags, added another stream --- cosmfetcher.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cosmfetcher.js b/cosmfetcher.js index e5730b3..6db581e 100644 --- a/cosmfetcher.js +++ b/cosmfetcher.js @@ -5,7 +5,7 @@ var assert = require('assert'), var hubAddress = '192.168.23.43', hubPort = 7110; var oscClient = new osc.Client(hubAddress, hubPort); -var streams = [ 91755, 70632, 53146, 45582 ]; +var streams = [ 91755, 70632, 53146, 45582, 64590 ]; var client = restify.createJsonClient({ url: 'http://api.cosm.com', headers: {'X-ApiKey':'orKBBdLAKuKJU-RxqmZpZB6q0baSAKxBTVhKdjhUNkdyVT0g'},version:'*' @@ -21,7 +21,7 @@ var getstream = function(streamId) { var dataStream = obj.datastreams[i]; if(dataStream.id != null) { var streamName = dataStream.id; - if(streamName.length < 2 && dataStream.tags.length > 0) streamName = dataStream.tags[0] + streamName; + if(streamName.length < 2 && dataStream.tags != null) streamName = dataStream.tags[0] + streamName; var address = '/cosm/' + obj.id + "/" + streamName; var currentValue = dataStream.current_value; @@ -31,6 +31,7 @@ var getstream = function(streamId) { if(recentvalues[address] != currentValue) { oscClient.send(address, currentValue); + console.log(address + ": " + currentValue); } recentvalues[address] = currentValue;