Giter Site home page Giter Site logo

wiesty / mmm-mensamuc Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 1.0 15 KB

MagicMirror² Module to display daily menu information from the canteens of the Studierendenwerk München Oberbayern as well as some other canteens.

License: MIT License

JavaScript 95.62% CSS 4.38%

mmm-mensamuc's Introduction

MMM-Mensamuc GitHub license

MagicMirror² Module to display daily menu information from the canteens of the Studierendenwerk München Oberbayern as well as some other canteens.

Data by eat-api by TUM-DEV

The meat dish is represented by a 🍖 emoji, the vegetarian dish by a 🥕 emoji, and the vegan dish by a 🥦 emoji.

image

Dependencies

  • instance of MagicMirror²
  • Node Fetch (linux: npm install node-fetch) (if not already installed)

Installation

  1. Clone this repository in your MagicMirror installation into the folder modules. git clone https://github.com/wiesty/MMM-Mensamuc.git
  2. Install dependencies in main MagicMirror folder
  3. Search your canteen and modify the config template below
  4. Add configuration to your config.js

Example Config

{
  module: "MMM-Mensamuc",
  position: "bottom_right",
  config: {
    canteen: "mensa-lothstr", // replace with your canteen
    dishTypeFilter: ["Tagesgericht", "Aktionsessen"] //  dishTypeFilter: ["ALL"] to disable the fitler
},

Supported canteens (by eat-api by TUM-DEV )

Name API-key Address
Mensa Arcisstraße mensa-arcisstr Arcisstraße 17, München
Mensa Garching mensa-garching Boltzmannstraße 19, Garching
Mensa Leopoldstraße mensa-leopoldstr Leopoldstraße 13a, München
Mensa Lothstraße mensa-lothstr Lothstraße 13d, München
Mensa Martinsried mensa-martinsried Großhaderner Straße 6, Planegg-Martinsried
Mensa Pasing mensa-pasing Am Stadtpark 20, München
Mensa Weihenstephan mensa-weihenstephan Maximus-von-Imhof-Forum 5, Freising
StuBistro Arcisstraße stubistro-arcisstr Arcisstraße 12, München
StuBistro Goethestraße stubistro-goethestr Goethestraße 70, München
StuBistro Großhadern stubistro-großhadern Butenandtstraße 13, Gebäude F, München
StuBistro Rosenheim stubistro-rosenheim Hochschulstraße 1, Rosenheim
StuBistro Schellingstraße stubistro-schellingstr Schellingstraße 3, München
StuBistro Martinsried stubistro-martinsried Großhadernerstr. 9a, 82152 Planegg-Martinsried
StuCafé Adalbertstraße stucafe-adalbertstr Adalbertstraße 5, München
StuCafé Akademie Weihenstephan stucafe-akademie-weihenstephan Alte Akademie 1, Freising
StuCafé Weihenstephan-Maximus stucafe-weihenstephan-maximus Maximus-von-Imhof-Forum 5, 85354 Freising
StuCafé Boltzmannstraße stucafe-boltzmannstr Boltzmannstraße 15, Garching
StuCafé in der Mensa Garching stucafe-garching Boltzmannstraße 19, Garching
StuCafé Karlstraße stucafe-karlstr Karlstraße 6, München
StuCafé Pasing stucafe-pasing Am Stadtpark 20, München
FMI Bistro Garching fmi-bistro Boltzmannstraße 3, Garching
IPP Bistro Garching ipp-bistro Boltzmannstraße 2, Garching

Note on "No menu available yet" Message If you see the message "No menu available yet." on your MagicMirror or in the developer console (with a log entry like "MMM-Mensamuc TUM EAT API has not added this week yet."), this is normal behavior. The menus are typically refreshed at the beginning of each week. If the menu for the current week has not been added yet, the module will display this message. It will be updated automatically as soon as the menu has been added.

mmm-mensamuc's People

Contributors

wiesty avatar

Stargazers

Kristjan ESPERANTO avatar Linus avatar luaxv avatar  avatar Benjamin Schmitz avatar  avatar

Watchers

 avatar

Forkers

rebexter

mmm-mensamuc's Issues

Error Fetching Menu - Invalid JSON Response

Description:

When using the MMM-Mensamuc module, an error occurs when attempting to fetch the menu data from the API. The error appears to be triggered when the API responds with an HTML document (e.g., a 404 page) instead of the expected JSON format. This results in the following error being logged:

MMM-Mensamuc.js:38 Error fetching menu: SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON MMM-Mensamuc.js:29 GET https://tum-dev.github.io/eat-api/mensa-lothstr/2024/34.json 404 (Not Found)

Steps to Reproduce:

  1. Set up the MMM-Mensamuc module.
  2. Configure the module to use a canteen for which there is no data available (e.g., by setting the canteen property to mensa-lothstr during a week where the data file is not available).
  3. Observe the error in the developer console.

Expected Behavior:

If the API response is not valid JSON or if a 404 error occurs, the module should handle the error gracefully by displaying a message such as "No menu available yet" instead of logging a syntax error.

Actual Behavior:

The module attempts to parse the HTML error page as JSON, leading to a syntax error being logged in the console.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.