Giter Club home page Giter Club logo

alexa-go-vote's Introduction

Alexa Go Vote Skill Lambda

This project provides a Lambda for an Alexa Skill to query for Election Information. Currently it only supports getting Polling Place information with the activation phrase of "Where do I vote?". It will then proceed to gather the registered street address and zip code and use those to query the Civic Info API and return the first polling place as a spoken place name and address. In future improvements we plan to return a Card to the user's Alexa app with links to Get To The Polls and could also expand to early vote site and drop box locations, in addition to ballot info.

Prerequisites

You will need to set up Amazon Web Services CLI on your machine. All Alexa Skills are hosted out of the US-EAST-1, so you will want to set your configuration accordingly.

You will also need Leiningen

Configuration

There are a couple of environment variables that the application needs:

CIVIC_API_KEY: the access key for the Civic Info API. PRODUCTION_DATA_ONLY: true|false whether the API should only return production data. DEBUG: set to true to have debug logging output turned on, defaults to false.

These environment vars will get pushed up the the Lambda function's environment. The way to configure them is on the command line like:

CIVIC_API_KEY=... PRODUCTION_DATA_ONLY=false lein cljs-lambda deploy

Deploying

Run lein cljs-lambda default-iam-role if you don't have yet have suitable execution role to place in your project file. This command will create an IAM role under your default (or specified) AWS CLI profile, and modify your project file to specify it as the execution default.

Otherwise, add an IAM role ARN under the function's :role key in the :functions vector of your profile file, or in :cljs-lambda -> :defaults -> :role.

Then:

$ CIVIC_API_KEY=... PRODUCTION_DATA_ONLY=true lein cljs-lambda deploy

Configure

The Lambda needs a bit of configuration to work. You need to add the Alexa Skill Kit to it, which is pretty simple click operation.

Also you need to configure an environment variable named CIVIC_API_KEY with the key it will use to call the Civic Info API. Make sure to Save after, it was easy to miss this the first time around.

Logging

In addition to the Alexa Skill Kit, you should also configure a CloudWatch Logs plugin too (also just a point and click affair), and when the code calls

(.log js/console "Some message")

This will show up in the CloudWatch Logs. This is a good way to debug things in situ as there are limited ways to test the whole thing.

alexa-go-vote's People

Contributors

tank157 avatar

Stargazers

Sofia avatar

Watchers

James Cloos avatar Sofia 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.