Generate a weather forecast for a GPS location
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
LICENSE
README.md
package.json
weather-forecast.js

README.md

weather-forecast

NPM

Generate a weather forecast for a GPS location

var forecast = require('weather-forecast');

var location = {
  latitude: "34.103987",
  longitude: "-118.406723"
};

forecast.getForecast(location.latitude, location.longitude, function(forecast) {
  var forecastStr = forecast.map(function(f){
    return "in " + f.hoursFromNow + "h: " + f.tempC + "˚C " + f.tempF + "";
  }).join(" ..... ");

  console.log("Forecast for " + location.latitude + ", " + location.longitude + ": " + forecastStr);
});