Process inputs to pandorabot using JavaScript

104 Views Asked by At

On my webpage I have a form that accesses a bot API via talk.js

    var pb = new Pandorabot("aiaas.pandorabots.com","1409611418607",
    "botipiranga" etc);

I have a series of .txt documents on a server, say, lyrics to songs.

I want to query the client inputs:

1 - appending his words as strings to an array object, real time;

2 - when the array reaches a given number of words, start looking for string intersections between the array and the .txt documents.

3- when I have a match of n words, trigger an event, and play the .mp3 relative to its lyrics.

4 - once the song starts, trigger a processing.pde animation during playback, using processing.min.js.

How do I create these intersections? How do I create the events?

0

There are 0 best solutions below