node-red-contrib-cognitive-services
Advanced tools
Comparing version 0.0.9 to 0.1.0
@@ -42,5 +42,12 @@ var request = require('request'); | ||
console.log("response.statusCode=" + response.statusCode + ", body=" + JSON.stringify(body)); | ||
if (response.statusCode == 200 && body != null && body.results != null && body.results.length > 0 && body.results[0] != null && body.results[0].probability != null) | ||
if (response.statusCode == 200 && body != null && body.results != null) | ||
{ | ||
msg.payload = body.results[0].probability; | ||
if (body.results.length > 0 && body.results[0] != null && body.results[0].probability != null) | ||
{ | ||
msg.payload = body.results[0].probability; | ||
} | ||
else | ||
{ | ||
msg.payload = null; | ||
} | ||
msg.detail = body; | ||
@@ -47,0 +54,0 @@ node.send(msg); |
{ | ||
"name": "node-red-contrib-cognitive-services", | ||
"version": "0.0.9", | ||
"version": "0.1.0", | ||
"description": "Microsoft Cognitive Services", | ||
@@ -19,2 +19,3 @@ "dependencies": { | ||
"spellcheck": "cognitive-services/spellcheck.js", | ||
"textanalytics": "cognitive-services/textanalytics.js", | ||
"weblm": "cognitive-services/weblm.js" | ||
@@ -21,0 +22,0 @@ } |
74363
24
703