A short alexa skill that tells you when the next train is leaving from your station.
Since I often either miss the last train at the station, or arrive 10+ minutes early, I made a short alexa skill that will let me know when the next two trains are leaving my station.
- Customize the code for your station
- git clone http://github.com/goizueta/mtaSkill
- 'cd mtaSkill'
npm install --prefix=. mta-gtfs
- Go to http://mtaapi.herokuapp.com/stations
- Write down the 3 digit code for the station you want the skill to alert you on
- In index.js change
MY_STATION_CODE
to a string with the value of that code - Go to http://datamine.mta.info/list-of-feeds
- Write down the feed_id for the train line you care about
- In index.js change
MY_TRAIN_FEED
to a number with the value of that feed_id - Zip the folder for later uploading to Lambda with
zip -r ../mtaSkill.zip *
- Create your Alexa skill
- Create an Alexa skill (named whatever you want) at https://developer.amazon.com/alexa/console/ask/create-new-skill
- Select 'Custom' for the skill model
- Copy the JSON in alexaIntent.json into the JSON Editor section of the Interaction model
- Go to the Endpoint page, select AWS Lambda ARN as your endpoint and copy down the skill ID that is given to you
- Save
- Create your Lambda function
- Create a Lambda function( named whatever you want)at https://console.aws.amazon.com/lambda/home?region=us-east-1#/create
- In Configuration add Alexa Skills Kit as a trigger
- Enter the Skill ID you copied in step 1
- Copy the ARN in the top right of the page and enter it into the Default Region field on your Alexa Skill Endpoint page
- In the Function Code section, select Upload a .ZIP file as the Code Entry Type and upload the zip file you made in step 1
- Select Node.js 6.10 as your runtime
- Enter
index.myHandler
as your handler - Click Save and Test in the top right.
- Test your skill
- Return to the Alexa console.
- Build your skill
- Test it with the command "Is it time to leave?"
Wouldn't be possible without:
MIT © Roberto Goizueta