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

node-red-node-openweathermap

Package Overview
Dependencies
Maintainers
2
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-red-node-openweathermap - npm Package Compare versions

Comparing version 0.0.3 to 0.1.0

locales/en-US/weather.json

2

package.json
{
"name" : "node-red-node-openweathermap",
"version" : "0.0.3",
"version" : "0.1.0",
"description" : "A Node-RED node that gets the weather report from openweathermap",

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

@@ -29,3 +29,3 @@ /**

} else {
node.error("Invalid lat provided",msg);
node.error(RED._("weather.error.invalid-lat"),msg);
return;

@@ -36,3 +36,3 @@ }

} else {
node.error("Invalid lon provided",msg);
node.error(RED._("weather.error.invalid-lon"),msg);
return;

@@ -60,3 +60,3 @@ }

if (url) {
node.status({fill:"blue",shape:"dot",text:"requesting"});
node.status({fill:"blue",shape:"dot",text:"weather.status.requesting"});
http.get(url, function(res) {

@@ -73,3 +73,3 @@ var weather = "";

} catch (e) {
callback("The API call returned invalid JSON");
callback(RED._("weather.error.invalid-json"));
return;

@@ -98,9 +98,9 @@ }

if (jsun.hasOwnProperty("dt")) { msg.time = new Date(jsun.dt*1000); }
msg.title = "Current Weather Information";
msg.description = "Current weather information at coordinates: " + msg.location.lat + ", " + msg.location.lon;
msg.payload.description = ("The weather in " + jsun.name + " at coordinates: " + jsun.coord.lat + ", " + jsun.coord.lon + " is " + jsun.weather[0].main + " (" + jsun.weather[0].description + ")." );
msg.title = RED._("weather.message.title");
msg.description = RED._("weather.message.description", {lat: msg.location.lat, lon: msg.location.lon});
msg.payload.description = (RED._("weather.message.payload", {name: jsun.name, lat: jsun.coord.lat, lon: jsun.coord.lon, main: jsun.weather[0].main, description: jsun.weather[0].description}));
callback();
} else {
if (jsun.message === "Error: Not found city") {
callback("Invalid city/country");
callback(RED._("weather.error.invalid-city_country"));
return;

@@ -120,3 +120,3 @@ } else {

} else {
callback("Invalid location information provided");
callback(RED._("weather.error.invalid-location"));
}

@@ -123,0 +123,0 @@ }

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