-
🤡 Hours of fun with Google Home, Alexa, Siri, Cortana: babeljs.io/repl/#?babili=true&evaluate=true&lineWrap=false&presets=es2017&targets=&browsers=&builtIns=false&code=(()%20%3D%3E%20%7B%0A%20%20let%20myAssistant%20%3D%20'OK%20Google%2C%20'%3B%0A%20%20new%20EventSource('http%3A%2F%2Ftwtr-sample.herokuapp.com').onmessage%20%3D%20e%20%3D%3E%20%7B%0A%20%20%20%20const%20tweet%20%3D%20JSON.parse(e.data)%3B%0A%20%20%20%20if%20(tweet.lang%20!%3D%3D%20'en')%20%7B%0A%20%20%20%20%20%20return%3B%0A%20%20%20%20%7D%0A%20%20%20%20const%20matches%20%3D%20tweet.text.match(%2F%5Cb(%3F%3Aok(%3F%3Aay)%3F%7Chey)%20(%3F%3Agoogle%7Calexa%7Ccortana%7Csiri)%2C%3F%20(.%2B%3F)%24%2Fi)%3B%0A%20%20%20%20if%20(matches)%20%7B%0A%20%20%20%20%20%20speechSynthesis.speak(new%20SpeechSynthesisUtterance(%60%24%7BmyAssistant%7D%24%7Bmatches%5B1%5D%7D%60))%3B%0A%20%20%20%20%7D%0A%20%20%7D%3B%0A%7D)()%3B%0A. Paste into the console and place laptop near your assistant…