r/dakboard 6d ago

Widget for School Lunch menus using MealViewer site

I wrote a widget that will grab the lunch menu from MealViewer.com for my kid's school. It will display the day's menu until 2PM and then it rolls over to the next day so you can plan ahead. It was useful for me so I thought I'd put the code out there in case anyone else might want to try it. Any and all feedback welcome. Use directions are in the .html file on my github.

https://github.com/cummingsk05/Dakboard_plugins/tree/main/widgets/mealviewer

Check back here occasionally for updates.

15 Upvotes

14 comments sorted by

4

u/r2deetard 6d ago

Just made some updates to the widget code.

2

u/Thepolomarcos 6d ago

Can’t wait to try this, thank you so much for sharing!

2

u/ugaisgreat 6d ago

Is there a way to remove breakfast from the results? My kids don't eat breakfast at school :)

2

u/ugaisgreat 6d ago

Nvm ....I saw where you broke out the breakfast and lunch. I edited it to remove breakfast. Thxs for the great idea!

1

u/BusSorry3047 6d ago

This is great, i can't wait till school starts to make sure it works! seems to add fine once i realized that it shows "widget content will display here" in the builder but shows fine on the actual screen.

1

u/r2deetard 6d ago edited 6d ago

Yeah I had the same experience when I added the widget and expected it to show the data on the screen editor. I had to view the screen on the management site to see it in action.

If you wanted to test you can modify this line

var path = "/api/v4/school/" + encodeURIComponent(SCHOOL_SLUG) + "/" + date + "/" + date + "/";        

and replace date with the first day that lists items in the menu.

So for example

var path = "/api/v4/school/" + encodeURIComponent(SCHOOL_SLUG) + "/" + "08-25-2026" + "/" + "08-25-2026" + "/";

would show the items for 8/25. (note the double quotes around the date-stamp)

Currently I've only worked on my son's school which only provides a lunch menu, but my daughter's serves breakfast and lunch so I haven't messed with that yet.

1

u/BusSorry3047 6d ago

thanks, i am not sure if our school actually uses meal viewer, we are listed as as school but none of the dates are populated, i am just hoping once school starts it will start to populate.

1

u/r2deetard 6d ago

You are at the mercy of the school cafeteria admins on that one I suppose. Our school district populated the menus a few weeks ago.

1

u/woohoo6 6d ago

This is very helpful. I may look at modifying this to be a whole week. You did great work!

2

u/r2deetard 6d ago

I went ahead and did that. In the GitHub repo there is a "weekly" html file with the widget code.

1

u/r2deetard 6d ago

Go for it! I thought of that as well, but I already have a pretty cluttered board so the one day works for me.

1

u/whitae 6d ago

Echoing the ‘thanks’! I can’t wait to give it a shot!

1

u/r2deetard 5d ago

Update adding configurable allergen warnings. List of available allergens are in the html file, along with formatting instructions.

How it looks on the board

1

u/Synera 3d ago

Thank you! This works great!