/lwsdmenu

Use a consistent url to access Lake Washingston School District menus

Primary LanguageJavaScript

lwsdmenu

The Lake Washington School District (LWSD) menu urls at https://www.lwsd.org/students-families/breakfast-and-lunch-menus change every time they are updated.

This requires manually updating the urls to keep them up to date on a kiosk.

Example:

Those urls will change on a regular basis.

I am assuming the same/similar thing could happen with all of the nutrition guides:

This Node JavaScript runs a server that selects elements out of the menu page and gets their current url.

Now the changing menu urls can be viewed with consistent urls:

NOTE that when requesting the nutrition info you must provide a non-empty User-Agent.

Example:

% curl --user-agent '' https://www.lwsd.org/fs/resource-manager/view/b3337911-2d56-4541-977a-8e6f9eefbd06 
error code: 1020
% curl --user-agent 'foo' https://www.lwsd.org/fs/resource-manager/view/b3337911-2d56-4541-977a-8e6f9eefbd06
<html><body>You are being <a href="https://resources.finalsite.net/images/v1677883990/lwsdorg/zjuigdjrwylpgfbgdlam/ESNutrientInfo.pdf">redirected</a>.<script defer src="https://static.cloudflareinsights.com/beacon.min.js/vaafb692b2aea4879b33c060e79fe94621666317369993" integrity="sha512-0ahDYl866UMhKuYcW078ScMalXqtFJggm7TmlUtp0UlD4eQk0Ixfnm5ykXKvGJNFjLMoortdseTfsRT8oCfgGA==" data-cf-beacon='{"rayId":"7a35bc359ff72762","token":"5fb20d0601a643df91b59062182249a8","version":"2023.2.0","si":100}' crossorigin="anonymous"></script>
</body></html>