MozScout / scout-alexa

INACTIVE - http://mzl.la/ghe-archive - Scout Alexa Skill
Mozilla Public License 2.0
4 stars 3 forks source link
inactive unmaintained

Scout Alexa Skill

Build Status Coverage Status

This is a lambda function that drives the Alexa skill for Scout.

Uses Alexa Skills Kit SDK for Node.js v2. Backwards compatibility with v1: see ASK SDK Migration Guide.

Setting up

Requirements: scout-ua, Auth Lamdba Functions and Auth API Gateways are deployed.

AWS Lambda

Create an AWS Lambda Function on AWS Lambda.

Add the following environment variables to your Lambda function:

Cross Compiling the natural packages

In order to run this on Amazon, some of the node packages need to be cross-compiled on Amazon Linux to work properly. Here is a set of steps to do this:

Alexa Skill Kit

Create an Alexa Skill on Alexa Skills Kit. You can put Scout as an invocation name.

Deployment

Deploy using ask deploy (require AWS command line tools). You may require to create an AWS IAM user with correct permissions to deploy with command line.

Enable on Alexa

Go to alexa.amazon.com. In Skills/Your Skills/Dev Skill you should see your Skill in development. Enable-it. You should get redirected to Pocket to authorize the app. Authorize-it.

Testing

Testing using Bespoken virtual-alexa.

To run tests, you need the following configuration:

Sample URLs that will make the tests pass: http://www.businessinsider.com/details-emerge-of-intel-ceo-brian-krzanich-office-affair-resignation-2018-6 https://www.bloomberg.com/news/articles/2018-09-18/amazon-dominates-early-emmy-awards-in-sign-tv-bet-is-paying-off https://www.theverge.com/transportation/2018/9/13/17856078/elon-musk-boring-company-underground-garage-hyperloop https://www.cnn.com/2018/09/19/politics/donald-trump-ethics-analysis/index.html https://techcrunch.com/2018/09/18/mozillas-firefox-reality-web-browser-is-now-available/ http://www.spiegel.de/politik/ausland/usa-paul-manafort-kooperiert-mit-sonderermittler-robert-mueller-a-1228236.html https://www.nytimes.com/2018/04/20/well/family/nobody-tells-you-how-long-a-marriage-is.html https://www.newyorker.com/books/page-turner/my-last-day-as-a-surgeon

Do not add more than the 8 URLs.

To run tests manually: npm test from inside the lambda/custom directory. The node_modules must be generated locally on the machine your running the tests from. Using the node_modules generated on the EC2 instance will not work. It's best to backup any EC2 node_modules directory you have, run npm install and then run npm test.

Note that tests may fail if run from a forked repo due to lack of security keys. Before landing a patch, please make sure that the integrations tests pass when you run them locally.