Apple Shortcuts Automation - What’s for Lunch Today?

At my school they have breakfast and lunch. They publish it on their website too. So I basically scrape it, get the lunch info, and at 6:50 AM, it sends me a notification that I can glance at while getting ready.

Now, it’s currently a little off, since we actually had no school Monday and started Tuesday, so they still wanted to give us the same foods in a row each day.

This automation uses my server https://lunchcuts.boston2029.repl.co/__repl to scrape the page using fetch and jsdom.

You can’t send automations I believe. I could send screenshots if someone wants, but a few more months ago I actually made a shortcut version of it that speaks it out in Siri’s voice, which you can check out here.

By the way it says “undefined” on weekends and breaks because, well, there’s no breakfast/lunch for those days. Heres the shortcut link: Shortcuts

Now I gotta get ready for school so bye

2 Likes

And the lunch looks a little scrappy with the comma separation, but that’s simply because they put “stuffed crust ” and “pizza” including the space after crust.

2 Likes

Hi @boston2029 ! How did you make your repl send notifications?

3 Likes

For the Repl, I use fetch to my schools online lunch calendar. I then take a querySelectorAll of all the item elements, which are usually something like [data-v-…] .lunch pre. I then send the response of (whatever lunch is)…(whatever breakfast is) with the dot dot dot to separate them. Back on the shortcuts end, we use Get contents of webpage to get the data. We use split text to get each item in an array (called a “list”). For the shortcut, we simply use the Speak command and make it say “for lunch we have (lunch), for breakfast we have (breakfast)”. As for the notifications, we simply use the Show Notification function. This sends notifications even if my phone is locked or anything

3 Likes

What is the speak command?
(Btw cool project!)

3 Likes

Speaks out provided text in a Siri voice or any voice you choose. You can even do different languages

2 Likes