meteorologist

Get some weather for your zip codes.

Meteorologist

Meteorologist is a wrapper around NOAA's weather forecasts. Since NOAA response is crappy XML, this library wrapper gives you nice pretty JSON on the weather forecasts that NOAA provides. And because it's really slow, it introduces a way to cache forecasts so the response is snappy.

You should clone this repository and run the following.

npm install
node server.js

You can then request on http://localhost:4000 with the following endpoints.

The following endpoints return daily forecats given on the location.

  • /forecast/gps/:lat/:lng
  • /forecast/zip/:zipcode

These endpoints return you hour to hour predictions throughout the days.

  • /predictions/gps/:lat/:lng
  • /predictions/zip/:zipcode

You can also use this as a module, note that it is built asynchronously, you'll need to npm install meteorologist.

var meteorologist = require('meteorologist');
meteorologist.forecast(:zipcode, function(res) // any 5 digit US zipcode
{
    console.log(res);
});
meteorologist.predictions(:zipcode, function(res)
{
  console.log(res);
});

Some important things to note is that the functionality will stay true to the requested location's timezone. Though the timezone is not listed, it will always be in that locale.

It is also important to note that the NOAA service is horrible and sometimes doesn't respond. It is important to check for .error in any of the responses just in case we encounter bad data.

MIT.