Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-red-bluemix-nodes

Package Overview
Dependencies
Maintainers
2
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-red-bluemix-nodes - npm Package Compare versions

Comparing version 1.0.2 to 1.0.4

2

package.json
{
"name": "node-red-bluemix-nodes",
"version": "1.0.2",
"version": "1.0.4",
"description": "A collection of extra Node-RED nodes for IBM Bluemix.",

@@ -5,0 +5,0 @@ "dependencies": {

@@ -20,9 +20,14 @@ /**

var services = cfenv.getAppEnv().services;
var username, password, host = 'https://twcservice.mybluemix.net';
var service = cfenv.getAppEnv().getServiceCreds(/insights for weather/i);
var username, password, host = 'https://twcservice.mybluemix.net', base_uri = '/api/weather/v1/geocode/';
var service;
for (var i in services) {
if (i.match(/^(weatherinsights)/i)) {
service = services[i][0];
}
}
if (service) {
username = service.username;
password = service.password;
host = 'https://' + service.host;
username = service.credentials.username;
password = service.credentials.password;
host = 'https://' + service.credentials.host;
}

@@ -52,7 +57,7 @@

if (typeof msg.payload === 'string' && msg.payload.match(lat_long_regex)) {
geocode = msg.payload;
geocode = msg.payload.replace(',', '/');
} else if (typeof msg.location === 'object') {
geocode = [msg.location.lat, msg.location.lon].join(',');
geocode = [msg.location.lat, msg.location.lon].join('/');
} else if (config.geocode.match(lat_long_regex)) {
geocode = config.geocode;
geocode = config.geocode.replace(',', '/');
} else {

@@ -67,3 +72,3 @@ var message2 = 'Missing valid latlong parameters on either msg.payload, msg.location or node config.';

node.status({fill:"blue", shape:"dot", text:"requesting"});
request({url: host + config.service, auth: {username: username, password: password}, qs: {geocode: geocode, units: config.units, language: config.language}}, function(error, response, body) {
request({url: host + base_uri + geocode + config.service, auth: {username: username, password: password}, qs: {units: config.units, language: config.language}}, function(error, response, body) {
node.status({});

@@ -70,0 +75,0 @@ if (!error && response.statusCode == 200) {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc