Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function FindItem(item, cb) {
- var output = ' nada';
- var itemName = '';
- var instructions = '';
- var whereItGoes = '';
- //Get Item name and Instructions
- var options1 = { ... };
- request(options1, function (error, response, body) {
- ...//Extracting Data here
- var options2 = { ... };
- //BTW: If you're wondering why I have a nested request, it's because I need to use an ID from the first request to get the right URL for this second request.
- request(options2, function (error, response, body) {
- ...//Extracting Data here
- output = itemName + '. ' + instructions + ' ' + whereItGoes;//For now, I'll say (some string)
- console.log('Output #1 ' + output);
- });
- console.log('Output #2 ' + output);
- });
- console.log('Output #3 ' + output);
- };
- Output #1 (some string)
- Output #2 (some string)
- Output #3 (some string)
- Output #1 nada
- Output #2 nada
- Output #3 (some string)
- //This is the template from JOVO
- app.setHandlet()({
- BindicatorIntent() {
- var response = 'wrong';
- FindItem(this.$inputs.Item.value, function (output) {
- console.log('This is the output im getting: ' + output);
- response = output;
- });
- this.ask(response);
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement