Skip to content

jeffsheets/alexa-papio-lunch-menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Papio Menu

Alexa Papillion Lunch Menu Skill

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/

Use it

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

How does it work?

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.

Deploy

  1. See Alexa ASK CLI Setup
  2. ask deploy

Test from local to cloud

  1. ask dialog
  2. type in alexa ask Papio Menu what's for lunch today to see the text response

Test speech

  1. In the Amazon Alexa Developer Console webpage, open the Test tab
  2. Allow microphone for your browser (if prompted)
  3. Long-press on the microphone icon and say Alexa ask Papio Menu what's for lunch today
  4. Listen as Alexa's response is spoken to you!

Local Debug

  1. 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-debuggers
    1. npm install --save-dev ask-sdk-local-debug
    2. npm install
  2. Generate a token
    ask util generate-lwa-tokens --scopes alexa::ask:skills:debug
  3. 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
    1. skillId can be found in your .ask/ask-states.json file

Create an Alexa skill for your own local school menu!

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.

  1. Look at how your school lunch menu is displayed on the web
    1. If you're lucky like me, the calendar already has a web API that returns a JSON object structure
    2. It will be more difficult if your menu is a PDF or image or other format....
  2. Read up on Amazon Alexa ASK CLI
  3. Generate your own new skill using ask new
  4. 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.
  5. Modify your version of skill.json, you can use this as reference: skill-package/skill.json
  6. Copy the LunchMenuIntentHandler code from lambda/index.js
    1. Now the custom part. You'll need to modify the code that retrieves the lunch menu entrees to work for your school district
  7. Test using the steps above
  8. When ready, submit through the Alexa Developer Console to get published on the Alexa app store!

Credits

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

TODO

About

Alexa will tell you the elementary lunch menu for today or tomorrow for Papillion LaVista Elementary Schools

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published