Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mannheim: JSON data source studiplus.stw-ma.de #3

Closed
cvzi opened this issue Aug 6, 2020 · 2 comments
Closed

Mannheim: JSON data source studiplus.stw-ma.de #3

cvzi opened this issue Aug 6, 2020 · 2 comments

Comments

@cvzi
Copy link
Owner

cvzi commented Aug 6, 2020

There is a JSON endpoint at studiplus.stw-ma.de described here zaratropia/ma-mensa-bot#5

http://studiplus.stw-ma.de/api/app/mensa/info?id=416&date=1496916000000&language=de
(Requires authentication)

{
    "id": "416",
    "title": "Mensa Hochschule Mannheim",
    "date": "2017-06-08T00:00:00+02:00",
    "address": "Mensa des Studierendenwerks Mannheim\r\nan der Hochschule Mannheim  |  Paul-Wittsack-Straße 10, Bau J\r\n68163 Mannheim",
    "openings": "Mo - Do:  11:15 - 14:00 Uhr, Freitag:   11:15 - 13:45 Uhr",
    "status": "1",
    "menuList":
    [
        {
            "id": "116",
            "title": "Menü 1",
            "rating": -1,
            "cssClass": "",
            "showOnFilter":
            [
                "278",
                "4281",
                "4277",
                "280",
                "4283"
            ],
            "inputs":
            [
                {
                    "name": "typ",
                    "value": null,
                    "inputType": "customSelection",
                    "inputDisplay": "caption"
                },
                {
                    "name": "inhalt",
                    "value": "<span  class=\"showOnFilter4281 showOnFilter4279 showOnFilter4277 showOnFilter280 showOnFilter4283 hideOnFilter2799 hideOnFilter278 hideOnFilter4285 hideOnFilter4275 hideOnFilter2699 hideOnFilter282 suppe\" >Klare Gemüsesuppe mit Eierriebele&nbsp;<small><sup>[Ei, Gl, GlW]</sup></small></span><span>, </span><span  class=\"showOnFilter278 showOnFilter4285 showOnFilter4281 showOnFilter4279 showOnFilter4277 showOnFilter280 showOnFilter4283 hideOnFilter2799 hideOnFilter4275 hideOnFilter2699 hideOnFilter282\" >Gebackenes Seelachsfilet&nbsp;<small><sup>[Fi, Gl, GlW]</sup></small></span><span>, </span><span  class=\"showOnFilter4281 showOnFilter4277 showOnFilter280 showOnFilter4283 hideOnFilter2799 hideOnFilter278 hideOnFilter4285 hideOnFilter4275 hideOnFilter4279 hideOnFilter2699 hideOnFilter282\"  style=\"white-space: nowrap;\">Joghurtremoulade&nbsp;<small><sup>[Ei, Gl, GlW, Lac, Mi]</sup></small></span><span>, </span><span  class=\"showOnFilter4285 showOnFilter4281 showOnFilter4275 showOnFilter4279 showOnFilter4277 showOnFilter280 showOnFilter4283 hideOnFilter2799 hideOnFilter278 hideOnFilter2699 hideOnFilter282\"  style=\"white-space: nowrap;\">Kartoffelsalat&nbsp;<small><sup>[Sf]</sup></small></span><span>, </span><span  class=\"showOnFilter4285 showOnFilter4281 showOnFilter4275 showOnFilter4279 showOnFilter4277 showOnFilter280 showOnFilter4283 hideOnFilter2799 hideOnFilter278 hideOnFilter2699 hideOnFilter282\"  style=\"white-space: nowrap;\">Karottensalat</span>",
                    "inputType": "articleSelection",
                    "inputDisplay": "text"
                },
                {
                    "name": "preisStudent",
                    "value": "2,90",
                    "inputType": "price",
                    "inputDisplay": "label"
                },
                {
                    "name": "preisBediensteter",
                    "value": null,
                    "inputType": "price",
                    "inputDisplay": null
                },
                {
                    "name": "preisGast",
                    "value": null,
                    "inputType": "price",
                    "inputDisplay": null
                },
                {
                    "name": "kennzeichnung",
                    "value": "2150",
                    "inputType": "tagSelection",
                    "inputDisplay": null,
                    "icons": ["fish"]
                }
            ]
        }
    ],
    "colors":
    {
        "chicken": "#CC6633",
        "carrot": "#FF6600"
    },
    "additives":
    [
        {"key":"Ei","value":"Ei","category":"Allergene","icon":null},
        {"key":"En","value":"Erdnüsse","category":"Allergene","icon":null},
        {"key":"Fi","value":"Fisch","category":"Allergene","icon":null},
        {"key":"Gl","value":"Glutenhaltiges Getreide","category":"Allergene","icon":null}
    ],
    "filter":
    [
        {"id":"2799","name":"mit Geflügel"},
        {"id":"278","name":"mit Fisch"}
    ]
}

It's not completely straightforward, because the meals name are HTML:

<span class="showOnFilter4281 showOnFilter4279 showOnFilter4277 showOnFilter280 showOnFilter4283 hideOnFilter2799 hideOnFilter278 hideOnFilter4285 hideOnFilter4275 hideOnFilter2699 hideOnFilter282 suppe">
    Klare Gemüsesuppe mit Eierriebele&nbsp;<small><sup>[Ei, Gl, GlW]</sup></small>
</span>
<span>, </span>
<span class="showOnFilter278 showOnFilter4285 showOnFilter4281 showOnFilter4279 showOnFilter4277 showOnFilter280 showOnFilter4283 hideOnFilter2799 hideOnFilter4275 hideOnFilter2699 hideOnFilter282">
    Gebackenes Seelachsfilet&nbsp;<small><sup>[Fi, Gl, GlW]</sup></small>
</span>
<span>, </span>
<span class="showOnFilter4281 showOnFilter4277 showOnFilter280 showOnFilter4283 hideOnFilter2799 hideOnFilter278 hideOnFilter4285 hideOnFilter4275 hideOnFilter4279 hideOnFilter2699 hideOnFilter282" style="white-space: nowrap;">
    Joghurtremoulade&nbsp;<small><sup>[Ei, Gl, GlW, Lac, Mi]</sup></small>
</span>
<span>, </span>
<span class="showOnFilter4285 showOnFilter4281 showOnFilter4275 showOnFilter4279 showOnFilter4277 showOnFilter280 showOnFilter4283 hideOnFilter2799 hideOnFilter278 hideOnFilter2699 hideOnFilter282" style="white-space: nowrap;">
    Kartoffelsalat&nbsp;<small><sup>[Sf]</sup></small>
</span>
<span>, </span>
<span class="showOnFilter4285 showOnFilter4281 showOnFilter4275 showOnFilter4279 showOnFilter4277 showOnFilter280 showOnFilter4283 hideOnFilter2799 hideOnFilter278 hideOnFilter2699 hideOnFilter282" style="white-space: nowrap;">
    Karottensalat
</span>

List of mensas/IDs can be found here:
https://studiplus.stw-ma.de/api/app/mensas

@cvzi cvzi changed the title Mannheim: JSON data source Mannheim: JSON data source studiplus.stw-ma.de Aug 10, 2020
@cvzi
Copy link
Owner Author

cvzi commented Aug 12, 2020

implemented in 30e0515 and 43e6087

@cvzi cvzi closed this as completed Aug 12, 2020
@cvzi
Copy link
Owner Author

cvzi commented Dec 9, 2021

List of all mensas:
https://studiplus.stw-ma.de/api/app/mensas

[
    {
        "id": 610,
        "name": "Mensa am Schloss",
        "url": ""
    },
    {
        "id": 710,
        "name": "greenes²®",
        "url": "https://www.greenes.de/wp-content/uploads/2021/11/Preisliste_Greenes_Digital_3.jpg"
    },
    {
        "id": 709,
        "name": "MensaWagon",
        "url": ""
    },
    {
        "id": 611,
        "name": "Mensa Hochschule Mannheim",
        "url": ""
    },
    {
        "id": 714,
        "name": "Cafeteria Musikhochschule",
        "url": ""
    },
    {
        "id": 613,
        "name": "Mensaria Metropol",
        "url": ""
    },
    {
        "id": 718,
        "name": "DHBW Eppelheim",
        "url": "https://www.stw-ma.de/-p-2000.html"
    },
    {
        "id": 614,
        "name": "Mensaria Wohlgelegen",
        "url": ""
    }
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant