davidmerrick / PortlandBus

Alexa skill for Portland bus arrivals, written in Kotlin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tl;dr

Alexa skill, written in Kotlin, to fetch TriMet arrivals for bus times in Portland, OR.

Try it out

You can try out the live skill here.

Usage

In the Lambda's handler field, set the handler to:

com.merricklabs.portlandbus.PortlandBusStreamHandler

Set the following environment variables:

  • SKILL_ID: Your Alexa skill's id.
  • DYNAMODB_ENDPOINT: Endpoint for DynamoDB. For example, in the Oregon region I'm using, it's https://dynamodb.us-west-2.amazonaws.com.
  • DYNAMODB_REGION: Region for DynamoDB. For example, us-west-2.
  • DYNAMODB_TABLE: DynamoDB table.
  • TRIMET_APP_ID: API key for accessing TriMet. Get one here.
  • INVOCATION_NAME: Name used to invoke your skill. Mine is Portland Bus.

Recommended settings

  • 512 MB of memory is plenty.
  • Timeout of 10s seems to work well and eliminate any DynamoDB calls prematurely timing out. Sometimes those are slow initially.

Reference

This guide was very helpful in getting up to speed on writing an Alexa skill in Java. I subsequently rewrote it in Kotlin.

Running locally

Use localstack to mock out the DynamoDB endpoints.

About

Alexa skill for Portland bus arrivals, written in Kotlin


Languages

Language:Kotlin 100.0%