Created
January 8, 2016 02:27
-
-
Save audstanley/cc4275ce7c517e7b08c7 to your computer and use it in GitHub Desktop.
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(robot) { | |
return robot.hear(/\{.?(movie):.?"(.*?)",?.?(year):.?"(.*?)",?.?(opt):.?"(.*?)".?}/, function(res) { | |
console.log("Got input, using " + res.match[2] + " for the title, and " + res.match[4] + " for the year."); | |
var movie = require('node-movie'); | |
var title = res.match[2]; | |
var year = res.match[4]; | |
console.log(title + ' ' + year); | |
function getMovie(movieData) { | |
movie('Alien', '1979', function (err, data) { | |
console.log(data.Poster); | |
res.send(data.Poster); | |
return movieData = data; | |
}); | |
} | |
process.nextTick(getMovie); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment