This Alexa app will speak the Papillion LaVista Elementary schools lunch menu entree options to you.
The calendar it reads from is at PLCS School Lunch Calendar
Alexa gets the calendar filtered for Prairie Queen Elementary, which I think should be the same for all schools? I picked PQ as that's the school closest to my home.
Published to the Amazon Alexa Skill store https://www.amazon.com/Jeff-Sheets-Papio-Menu-Lunch/dp/B08ZNJ2FQY/
Alexa, ask Papio Menu what's for lunch today
Alexa, ask Papio Menu what is for lunch tomorrow
Alexa, ask Papio Menu what are we having for lunch on Thursday
Alexa, ask Papio Menu what is for lunch March 9, 2021
This hits the JSON API endpoint for the school lunch calendar, then parses it, and Alexa reads it back to us.
It could break at any time if the schools calendar app changes, or the developer of the current school lunch program changes their code.
- See Alexa ASK CLI Setup
ask deploy
ask dialog
- type in
alexa ask Papio Menu what's for lunch today
to see the text response
- In the Amazon Alexa Developer Console webpage, open the Test tab
- Allow microphone for your browser (if prompted)
- Long-press on the microphone icon and say
Alexa ask Papio Menu what's for lunch today
- Listen as Alexa's response is spoken to you!
- This allows the
ask dialog
to hit breakpoints in your local IntelliJ or VSCode
See https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs/tree/2.0.x/ask-sdk-local-debug#using-with-other-ides-and-debuggersnpm install --save-dev ask-sdk-local-debug
npm install
- Generate a token
ask util generate-lwa-tokens --scopes alexa::ask:skills:debug
- Setup node process in IntelliJ or VSCode
node ./node_modules/ask-sdk-local-debug/dist/LocalDebuggerInvoker.js --accessToken <FromStep2> --skillId <YOUR_SKILL_ID> --skillEntryFile index.js --handlerName handler
skillId
can be found in your .ask/ask-states.json file
The hardest part is choosing a good name! Most of the code is auto-generated by the ASK CLI. Really this could be a great High School or Middle School coding project.
- Look at how your school lunch menu is displayed on the web
- If you're lucky like me, the calendar already has a web API that returns a JSON object structure
- It will be more difficult if your menu is a PDF or image or other format....
- Read up on Amazon Alexa ASK CLI
- Generate your own new skill using
ask new
- I selected the "Lambda" option, as I first tried the Alexa-hosted option but I was having issues deploying code with it. The choice is up to you though, it shouldn't matter much besides the deploy steps.
- Modify your version of skill.json, you can use this as reference: skill-package/skill.json
- Copy the LunchMenuIntentHandler code from lambda/index.js
- Now the custom part. You'll need to modify the code that retrieves the lunch menu entrees to work for your school district
- Test using the steps above
- When ready, submit through the Alexa Developer Console to get published on the Alexa app store!
Data is sourced from a calendar menu API found at PLCS School Lunch Calendar
Uses the ASK CLI from AWS for Alexa.
Function code is inspired by https://github.com/adamgruber/alexa-lunchlady
Apple image clipart found for free from http://clipart-library.com/free-apple-clipart.html
- Refactor the "menu retrieval" code into a service
- Cache the calendar lookup results (or lambda execution by params) for an hour or two
- Unit tests
- Setup CI/CD or tryout the Alexa-hosted CI/CD process that didn't work for me the first time
- Why does Amazon have ask-resources.json in .gitignore by default?
https://developer.amazon.com/en-US/docs/alexa/smapi/ask-cli-command-reference.html#init-command