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
Changes from 1 commit
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
Prev Previous commit
Next Next commit
I am an idiot
daemonsy committed Jun 30, 2017
commit 3b57f6a80e12b442bae8c3aa7b1bf55f12a6aa46
4 changes: 2 additions & 2 deletions handlers/store-favorite-line.js
Original file line number Diff line number Diff line change
@@ -4,11 +4,11 @@ const closestLineMatcher = require('../utilities/closest-line-matcher.js');
module.exports = function() {
let heardNameGroup = this.event.request.intent.slots.subwayLineOrGroup.value;

if(!nameGroup) { this.emit(':tell', "Sorry, I didn't hear a subway line or group I recognized") };
if(!heardNameGroup) { this.emit(':tell', "Sorry, I didn't hear a subway line or group I recognized") };

fetchMTAStatus(statuses => {
let closestLine = closestLineMatcher(statuses, 'nameGroup', heardNameGroup);

this.emit('tell', `Your favorite line is ${closestLine.nameGroup}`);
this.emit(':tell', `Your favorite line is ${closestLine.nameGroup}`);
});
}