Skip to content

Instantly share code, notes, and snippets.

@kconragan
Created April 17, 2012 19:13

Revisions

  1. kconragan created this gist Apr 17, 2012.
    17 changes: 17 additions & 0 deletions gistfile1.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    // 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);
    })
    };