This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.listLogs = function(req, res) { | |
SurfSession.find() | |
.populate('location') | |
.run(function(err, log) { | |
Wave.find(function(err, waves) { | |
var surfHeight = SurfSession.schema.path('surfHeight').enumValues; | |
var surfConditions = SurfSession.schema.path('surfConditions').enumValues; | |
var surfStoke = new SurfSession().generateStoke(); | |
var currentYear = moment().year(); | |
var surfSessionsThisYear = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Takes NDBC Buoy ID, and returns | |
// series of readings | |
// Just to generate a URL. | |
var BuoyURL = function(buoyId) { | |
return 'http://www.ndbc.noaa.gov/data/5day2/' + buoyId + '_5day.txt'; | |
}; | |
exports.parseBuoyData = function(buoy) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var moment = require('moment'); | |
var request = require('request'); | |
exports.formatDate = function(format, date) { | |
}; | |
// Takes NDBC Buoy ID, and returns | |
// series of readings | |
var fetchBuoy = function(buoyId) { | |
request('http://www.ndbc.noaa.gov/data/5day2/' + buoyId + '_5day.txt', function(err, response, body){ |