Coder Social home page Coder Social logo

muni-alexa-skill's Introduction

MUNI Alexa Skill

Add incoming MUNI predictions to Amazon Echo's Alexa using this small skill. It's not published in the skills directory but you can deploy it with your own settings using AWS Lambda function and let it run for free.

Currently the skill only supports one stop and you need to hardcode the SFMTA stop number in index.js. Look up the nearest stop around your place using 511.

Adding a new developer skill

To get started, add a new Alexa Skill Set in Amazon Developer Console. Once you created a new app, give it the following settings:

Skill Information

  • Application Id - Copy this to index.js
  • Skill type: Custom Interaction Model
  • Name: Name of your choosing, e.g. "Arriving Muni"
  • Invocation Name: Command that your Alexa listens, e.g. "arriving muni"

Interaction model

For Intent Scema, set:

{
  "intents": [
    {
      "intent": "GetNextMuni"
    }
  ]
}

As this script is only invoced using the invocation name, no Sample Utterances is really needed, but as the form requires a value:

GetNextMuni lol

Configuration

It's dead simple to deploy Alexa skills using AWS Lambda, so for Endpoint select Lambda ARN (Amazon Resource Name). Now, construct your Lambda function with node_modules directory. This is required as Lambda is unable to pull NPM modules and they need to be bundled with the code. Please note that at this point you should have set applicationId and muniStop variables in the index.js:

git clone https://github.com/jorilallo/muni-alexa-skill.git
cd muni-alexa-skill

npm install
zip -r lambda_function.zip *

After this you'll need to deploy lambda_function.zip as a Lambda function:

  1. Login to AWS Console and visit Lambda settings
  2. Select Create Lambda Function
  3. Skip blueprint selection
  4. Set function name, e.g. nextMuni and select Node.js runtime
  5. Upload as a Zip file (lambda_function.zip) to Lambda function
  6. Use index.handler handler and select Basic Execution Role for Role
  7. Create Lambda function. Click the "Event Sources" tab and select "Alexa Skills Kit"
  8. Finally, copy ARN from top right corner to your custom Alexa skill settings.

Once you have completed these steps, and pointed Alexa skill to the Lambda function, you should be able to test your skill with your "Alexa, ask arriving muni". While this isn't really natural, the list of invocation words is still somewhat limited.

muni-alexa-skill's People

Contributors

jorilallo avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.