Last active
February 13, 2016 23:55
-
-
Save export-mike/9b4c0e3b4e65455ca0a1 to your computer and use it in GitHub Desktop.
lnug-tito-twitter-hook.io
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
module['exports'] = function titoTwitterList (hook) { | |
var body = hook.req.body; | |
var twitterAnswer = body.answers.filter(function (a) { | |
return a.question.title === 'Twitter'; | |
})[0]; | |
if (twitterAnswer && twitterAnswer.response) { | |
console.log('Username: ' + twitterAnswer.response); | |
} else { | |
hook.res.end('Unrecognised payload'); | |
} | |
}; | |
module['exports'].schema = { | |
"answers": [] | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment