Skip to content

A module for the MagicMirror framework that retrieves a school meal menu from the LinqConnect API (formerly known as the Titan Schools API)

Notifications You must be signed in to change notification settings

evanhsu/MMM-TitanSchoolMealMenu

Repository files navigation

MMM-TitanSchoolMealMenu

A module for the MagicMirror² framework that retrieves a school meal menu from the LinqConnect API (api.linqconnect.com). LinqConnect was formerly known as "Titan Schools" (family.titank12.com).


Screenshot

Install

Clone MMM-TitanSchoolMealMenu into the modules folder of your MagicMirror² installation:

cd ~/MagicMirror/modules
git clone https://github.com/evanhsu/MMM-TitanSchoolMealMenu
npm install

Update

Go to the MMM-TitanSchoolMealMenu folder inside MagicMirror² modules folder and pull the latest version from GitHub:

cd ~/MagicMirror/modules/MMM-TitanSchoolMealMenu
git pull
npm install

Restart MagicMirror² after updating.

Usage

Add this to your MagicMirror² config.js:

{
    module: "MMM-TitanSchoolMealMenu",
    position: "top_left",
    header: "School Menu",
    config: {
        size: 'medium', // Optional: 'small', 'medium', 'large'; Default: 'medium'
        buildingId: '23125610-cbbc-eb11-a2cb-82fe13669c55',
        districtId: '93f76ff0-2eb7-eb11-a2c4-e816644282bd',
        updateIntervalMs: 3600000, // Optional: Milliseconds between updates; Default: 3600000 (1 hour)
        numberOfDaysToDisplay: 3, // Optional: 0 - 5; Default: 3
        recipeCategoriesToInclude: [
            "Entrees",
            "Grain"
            // , "Fruit"
            // , "Vegetable"
            // , "Milk"
            // , "Condiment"
            // , "Extra"
        ],
        debug: false // Optional: boolean; Default: false; Setting this to true will output verbose logs
    },
},

You can also track multiple school menus by listing the module multiple times in your config.js file (each config will probably have a different buildingId/districtId):

{
    module: "MMM-TitanSchoolMealMenu",
    position: "top_right",
    header: "The Derek Zoolander Center for Kids Who Can't Read Good and Wanna Learn to Do Other Stuff Good Too.",
    config: {
        buildingId: '7833a90f-a4bc-eb11-a2cb-8711b287b526',
        districtId: '93f76ff0-2eb7-eb11-a2c4-e816644282bd',
    },
},
{
    module: "MMM-TitanSchoolMealMenu",
    position: "top_left",
    header: "School for Kid #1",
    config: {
        buildingId: "9017b6ae-a3bc-eb11-a2cb-82fe13669c55",
        districtId: "93f76ff0-2eb7-eb11-a2c4-e816644282bd",
    }
},

Multiple Schools

Options

These are the possible options:

Option Description
buildingId

The buildingId found on the LinqConnect webpage.

REQUIRED
Type: string
Example: "23125610-cbbc-eb11-a2cb-82fe13669c55"
Default value: none

NOTE: See Finding your buildingId and districtId below

districtId

The districtId found on the LinqConnect webpage.

REQUIRED
Type: string
Example: "93f76ff0-2eb7-eb11-a2c4-e816644282bd"
Default value: none

NOTE: See Finding your buildingId and districtId below

retryDelayMs

How long to wait to retry after an error from the API.

Type: integer
Possible values: 0 - ?
Default value: 20000 (20 seconds)
Unit: milliseconds

updateIntervalMs

The time in milliseconds when the menu should be updated.

Type: integer
Possible values: 0 - ?
Default value: 3600000 (1 hour)
Unit: milliseconds

numberOfDaysToDisplay

The number of days to display menu items.

Type: integer
Possible values: 0 - ?
Example: 5
Default value: 3
Unit: days

Note: If displayCurrentWeek is true, this will be the number of days after the first day of the week, not today.

size

The css class for the font size.

Type: string
Possible values: x-small, small, medium, large, xlarge
Example: "small"
Default value: medium

Note: You can use any css class here, not just font sizes.

todayClass

The css class for today's meal.

Type: string
Possible values: x-small, small, medium, large, xlarge
Example: "medium bright"
Default value: large

Note: You can use any css class here, not just font sizes.

displayCurrentWeek

Display meals starting from the first day of the week instead of today.

Type: boolean
Default value: false
Possible values: true and false

weekStartsOnMonday

Show Monday as the first day of the week. Set to true to show Monday as the first day of the week.

Type: boolean
Default value: false
Possible values: true and false

hideEmptyDays

Hide days without any meals.

Type: boolean
Default value: false
Possible values: true and false

hideEmptyMeals

Hide meals that are empty.

Type: boolean
Default value: false
Possible values: true and false

recipeCategoriesToInclude

An array of recipe categories to display.

Type: array
Example: [ "Entrees", "Grain", "Fruit", "Vegetable" ]
Default value: [ "Entrees", "Grain" ]
Possible values: Any valid category in the API as an array. (See example)

Note: Your district might not use the categories in this module. You will need to find the categories by visting the website.

Note 2: If this is blank ([]), all categories will be selected.

debug

Setting this to true will output verbose logs.

Type: boolean
Default value: false
Possible values: true and false


Finding your buildingId and districtId

  1. Go to the LinqConnect webpage and search for your school district: https://linqconnect.com/

Search for your school district

  1. Select your school from the dropdown and use your browser's developer tools to inspect the resulting request to the /FamilyMenu endpoint. The districtId and buildingId will be present as query string parameters on this requests.

Use developer tools to inspect a network request

About

A module for the MagicMirror framework that retrieves a school meal menu from the LinqConnect API (formerly known as the Titan Schools API)

Topics

Resources

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •