Skip to content

Instantly share code, notes, and snippets.

@teeler
teeler / index.js
Created May 9, 2012 03:10 — forked from kconragan/index.js
list surf sessions
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;
// 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) {
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){