Last active
December 22, 2015 09:59
-
-
Save weisjohn/6455804 to your computer and use it in GitHub Desktop.
A joke
This file contains 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 chirp = require('twitter') | |
, _ = require('lodash') // cause underscore is so 2009.. | |
; | |
module.exports = function(app) { | |
// bro shortcuts for getting the tweets | |
app.get('/mah/chirps', function(req, res) { | |
// closures, like a pro javascript dude | |
function hollaback(fail, party) { | |
if (fail || !party) return res.send(500, fail); | |
res.send(_.cloneDeep(party)); // don't send our only copy | |
} | |
chirp.getTweets(hollaback); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment