Skip to content

Instantly share code, notes, and snippets.

@omatt
Last active December 16, 2015 04:29
Show Gist options
  • Save omatt/5377166 to your computer and use it in GitHub Desktop.
Save omatt/5377166 to your computer and use it in GitHub Desktop.
Tropo Sample storing online accounts user data.
var askAccount = ask("What's the online account details that you want to know?You can select Facebook or Twiiter", {
choices: "facebook, twitter, github",
timeout: 20.0,
attempts: 3,
onBadChoice: function(askAccount) {
say("I'm sorry, I didn't understand that. You can select facebook or twitter.");
},
onChoice: function(askAccount) {
if(askAccount.value == "facebook"){
say("Your username is sample@facebook.com");
var askConfirm = ask("Is this your account? Yes or No.",{
choices: "yes, no"
});
if(askConfirm.value == "yes")
say("Your Facebook Password is... Password1234567T");
else if(askConfirm.value == "no")
say("Thank you for using our app.");
}
if(askAccount.value == "twitter"){
say("Your username is sample@twitter.com");
var askConfirm = ask("Is this your account? Yes or No.",{
choices: "yes, no"
});
if(askConfirm.value == "yes")
say("Your Twitter Password is... Password1234567T");
else if(askConfirm.value == "no")
say("Thank you for using our app.");
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment