Skip to content

Instantly share code, notes, and snippets.

@teeler
Created April 18, 2012 05:58
Show Gist options
  • Save teeler/2411377 to your computer and use it in GitHub Desktop.
Save teeler/2411377 to your computer and use it in GitHub Desktop.
without bullshit
var request = require("request")
var parseBuoyData(buoyid, cb) {
request(buoyURL(buoyid), function(e, r, b) {
if (e) {
throw new Error(e)
}
// do all that insane parsing nonsense here
cb(results)
});
}
// From the handler,
parseBuoyData(buoyID, function(results) {
res.send(results);
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment