Comparing version 0.1.0 to 0.1.1
{ | ||
"name": "relayr", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Relayr sensor SDK for node", | ||
@@ -5,0 +5,0 @@ "main": "relayr.js", |
@@ -12,12 +12,12 @@ var request = require("request"); | ||
var pubnubkeys = {}; | ||
var pubnubkeys = {}; | ||
pubnubkeys.cipher_key = data.cipherKey; | ||
pubnubkeys.auth_key = data.authKey; | ||
pubnubkeys.subscribe_key = data.subscribeKey; | ||
pubnubkeys.channel = data.channel; | ||
listen(pubnubkeys); | ||
pubnubkeys.cipher_key = data.cipherKey; | ||
pubnubkeys.auth_key = data.authKey; | ||
pubnubkeys.subscribe_key = data.subscribeKey; | ||
pubnubkeys.channel = data.channel; | ||
listen(pubnubkeys); | ||
}); | ||
}); | ||
@@ -41,3 +41,3 @@ }; | ||
console.log("Retrieving Pubnub Keys"); | ||
console.log("Retrieving Pubnub Keys"); | ||
@@ -59,26 +59,26 @@ request.post(options,function(err,data){ | ||
var listen = function(pubnubkeys) { | ||
var connection = pubnub.init(pubnubkeys); | ||
var connection = pubnub.init(pubnubkeys); | ||
console.log("Connecting to Relayr Sensors"); | ||
console.log("Connecting to Relayr Sensors"); | ||
connection.subscribe({ | ||
channel : pubnubkeys.channel, | ||
callback : function(message) { | ||
var err = null; | ||
try { | ||
message = JSON.parse(message); | ||
} catch (ex) { | ||
err = ex; | ||
} | ||
listeners.forEach(function(listener){ | ||
listener(err,message); | ||
}); | ||
}, | ||
error:function(err) { | ||
console.log("Relayr Error!"); | ||
console.log(err); | ||
} | ||
}); | ||
connection.subscribe({ | ||
channel : pubnubkeys.channel, | ||
callback : function(message) { | ||
var err = null; | ||
try { | ||
message = JSON.parse(message); | ||
} catch (ex) { | ||
err = ex; | ||
} | ||
listeners.forEach(function(listener){ | ||
listener(err,message); | ||
}); | ||
}, | ||
error:function(err) { | ||
console.log("Relayr Error!"); | ||
console.log(err); | ||
} | ||
}); | ||
}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4436