Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Add storing of Favorite lines to the Alexa skill #8

Open
wants to merge 27 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
259aec6
Add Dynamo DB integration as recommended by the SDK
daemonsy Jun 26, 2017
56879e0
Set env variables based on deployment branches
daemonsy Jun 26, 2017
b29d546
Build ENV vars correctly for development / production versions
daemonsy Jun 27, 2017
70132ea
Use dynamodb local for testing
daemonsy Jun 27, 2017
7b64891
Use fork of ASK SDK
daemonsy Jun 28, 2017
1b4a48d
Automate the use of DynamoDB
daemonsy Jun 29, 2017
578c131
Clean up
daemonsy Jun 29, 2017
22b6074
Add an intent for storing a favorite line
daemonsy Jun 29, 2017
54e83a5
Ignore the dynamodb_local directory
daemonsy Jun 30, 2017
74185d7
Refactor and extract useful parts for the new handler
daemonsy Jun 30, 2017
6995206
Merge pull request #9 from daemonsy/da/fav-line
daemonsy Jun 30, 2017
8505402
This is not needed anymore
daemonsy Jun 30, 2017
bdc860d
Remove dotenv
daemonsy Jun 30, 2017
3b57f6a
I am an idiot
daemonsy Jun 30, 2017
1c600f8
[WIP] Store the favorite line uttered by the user
daemonsy Jun 30, 2017
db422d8
A first step at making sure DynamoDB works
daemonsy Jul 1, 2017
53da752
Add some personality?
daemonsy Jul 1, 2017
619c525
Ok having versions in dev mode is too much
daemonsy Jul 1, 2017
fed0155
Enlist Set's help to ensure uniqueness
daemonsy Jul 1, 2017
50c81ae
Can't store array vars in YAML
daemonsy Jul 1, 2017
bb2b952
Put pictures into assets folder to avoid getting bundled
daemonsy Jul 1, 2017
5a3b94d
[FEATURE] Allow the checking of specified watched lines
daemonsy Jul 1, 2017
c12c6d4
A missing quote can cause the downfall of an empire
daemonsy Jul 1, 2017
839b15f
And of course, actually use the handler
daemonsy Jul 1, 2017
74b3f14
Store work location WIP
daemonsy Jul 3, 2017
ae5dad8
Make some progress in getting dialog and MTA data ready
daemonsy Jul 7, 2017
b316cb1
Start building the logic of storing commute
daemonsy Jul 8, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
node_modules
subway.zip
.env*
.env
downloads
.vscode
dynamodb_local
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

[NYC Subway](http://alexa.amazon.com/spa/index.html#skills/dp/B01MR1N9YH) is an Alexa Custom Skill that gives you an update on subway statuses.

![](nyc-subway-skill.png)
![](assets/nyc-subway-skill.png)

This repository contains code for the skill's lambda handler.

Expand Down
File renamed without changes
File renamed without changes
494 changes: 494 additions & 0 deletions assets/mta/Stations.csv

Large diffs are not rendered by default.

Binary file added assets/mta/google_transit.zip
Binary file not shown.
File renamed without changes
28 changes: 23 additions & 5 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ machine:
version: $NODE_RUNTIME_VERSION
environment:
NODE_RUNTIME_VERSION: 6.10 # To be the same version AWS Lambda uses
YARN_VERSION: 0.18.1
YARN_VERSION: 0.24.6
PATH: "${PATH}:${HOME}/.yarn/bin:${HOME}/${CIRCLE_PROJECT_REPONAME}/node_modules/.bin"
AWS_DEFAULT_REGION: us-east-1
AWS_LAMBDA_PRODUCTION_ARN: arn:aws:lambda:us-east-1:750878068186:function:mtaStatus
AWS_FB_LAMBDA_PRODUCTION_ARN: arn:aws:lambda:us-east-1:750878068186:function:mtaStatusFlashBriefing
MTA_STATUS_URL: http://web.mta.info/status/serviceStatus.txt
TARGET_ENV: $(if [[ "$CIRCLE_BRANCH" == "development" ]]; then echo development; else echo production; fi)

dependencies:
pre:
Expand All @@ -18,24 +20,40 @@ dependencies:
else
echo "The correct version of Yarn is already installed."
fi
- yarn run dynamodb:download
- yarn run dynamodb:start:
background: true
- sleep 10

override:
- yarn install

cache_directories:
- ~/.yarn
- ~/.cache/yarn
- ~/nyc-subway/downloads

test:
override:
- yarn test

deployment:
development:
branch: development
commands:
- yarn release
- 'aws lambda update-function-code --function-name $AWS_LAMBDA_PRODUCTION_ARN --zip-file fileb://subway.zip'
- 'aws lambda update-function-code --function-name $AWS_FB_LAMBDA_PRODUCTION_ARN --zip-file fileb://subway.zip'
- 'aws lambda update-function-configuration --function-name $AWS_FB_LAMBDA_PRODUCTION_ARN --runtime "nodejs${NODE_RUNTIME_VERSION}" --environment "Variables={NODE_ENV=$TARGET_ENV,APPLICATION_ID=$ALEXA_FB_APPLICATION_ID,MTA_STATUS_URL=$MTA_STATUS_URL}"'
- 'aws lambda update-function-configuration --function-name $AWS_LAMBDA_PRODUCTION_ARN --runtime "nodejs${NODE_RUNTIME_VERSION}" --environment "Variables={NODE_ENV=$TARGET_ENV,APPLICATION_ID=$ALEXA_APPLICATION_ID,MTA_STATUS_URL=$MTA_STATUS_URL}"'

master:
branch: master
commands:
- yarn release
- 'aws lambda update-function-code --function-name $AWS_LAMBDA_PRODUCTION_ARN --zip-file fileb://subway.zip'
- 'aws lambda publish-version --function-name $AWS_LAMBDA_PRODUCTION_ARN --description "SHA: $CIRCLE_SHA1 Github: $CIRCLE_COMPARE_URL Build Number: $CIRCLE_BUILD_NUM"'
- 'aws lambda update-function-configuration --function-name $AWS_LAMBDA_PRODUCTION_ARN --runtime "nodejs${NODE_RUNTIME_VERSION}"'
- 'aws lambda update-function-code --function-name $AWS_FB_LAMBDA_PRODUCTION_ARN --zip-file fileb://subway.zip'
- 'aws lambda publish-version --function-name $AWS_FB_LAMBDA_PRODUCTION_ARN --description "SHA: $CIRCLE_SHA1 Github: $CIRCLE_COMPARE_URL Build Number: $CIRCLE_BUILD_NUM"'
- 'aws lambda update-function-configuration --function-name $AWS_FB_LAMBDA_PRODUCTION_ARN --runtime "nodejs${NODE_RUNTIME_VERSION}"'
- 'aws lambda update-function-configuration --function-name $AWS_FB_LAMBDA_PRODUCTION_ARN --runtime "nodejs${NODE_RUNTIME_VERSION}" --environment "Variables={NODE_ENV=$TARGET_ENV,APPLICATION_ID=$ALEXA_FB_APPLICATION_ID,MTA_STATUS_URL=$MTA_STATUS_URL}"'
- 'aws lambda update-function-configuration --function-name $AWS_LAMBDA_PRODUCTION_ARN --runtime "nodejs${NODE_RUNTIME_VERSION}" --environment "Variables={NODE_ENV=$TARGET_ENV,APPLICATION_ID=$ALEXA_APPLICATION_ID,MTA_STATUS_URL=$MTA_STATUS_URL}"'
- 'aws lambda publish-version --function-name $AWS_LAMBDA_PRODUCTION_ARN --description "Branch: $CIRCLE_BRANCH SHA: $CIRCLE_SHA1 Github: $CIRCLE_COMPARE_URL Build Number: $CIRCLE_BUILD_NUM"'
- 'aws lambda publish-version --function-name $AWS_FB_LAMBDA_PRODUCTION_ARN --description "Branch: $CIRCLE_BRANCH SHA: $CIRCLE_SHA1 Github: $CIRCLE_COMPARE_URL Build Number: $CIRCLE_BUILD_NUM"'
Loading