Skip to content

Instantly share code, notes, and snippets.

@kconragan
Created April 17, 2012 19:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kconragan/2408364 to your computer and use it in GitHub Desktop.
Save kconragan/2408364 to your computer and use it in GitHub Desktop.
// Takes NDBC Buoy ID, and returns
// series of readings
var fetchBuoy = function(buoyId) {
var path = 'http://www.ndbc.noaa.gov/data/5day2/' + buoyId + '_5day.txt';
request(path, function(err, response, body) {
if(err) {
throw err;
}
return body;
});
};
exports.parseBuoyData = function(buoy) {
var buoys = fetchBuoy(buoy).then(function(data) {
console.log(data);
})
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment