Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Generate a weather forecast for a GPS location
JavaScript
branch: master

Merge pull request #1 from richorama/master

Allow any 2xx or 3xx response code
latest commit 634b75545e
@Maciek416 authored
Failed to load latest commit information.
.gitignore Initial commit
LICENSE Initial commit
README.md Update README.md
package.json initial codebase
weather-forecast.js call 'done' on error conditions

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);
});
Something went wrong with that request. Please try again.