f4lco / om-parser-stw-potsdam-v2

Connect canteens of the Studentenwerk Potsdam to OpenMensa
3 stars 7 forks source link

SWP partly switched to Webspeiseplan; current menu only contains redirect #20

Closed adi64 closed 10 months ago

adi64 commented 1 year ago

The Studentenwerk seems to be switching to webspeiseplan.de (https://swp.webspeiseplan.de/Menu). So far e.g. Griebnitzsee still uses the "old" page, but e.g. Filmuniversität uses the new one.

Are you interested in building a new integration? Otherwise I might look into it :)

adi64 commented 1 year ago

The main content can be retrieved like this: curl 'https://swp.webspeiseplan.de/index.php?token=55ed21609e26bbf68ba2b19390bf7961&model=menu&location=9603&languagetype=1' -H 'Referer: https://swp.webspeiseplan.de/Menu' Referer is important, otherwise the result is empty. The token is currently hardcoded in the main.*.js.

f4lco commented 1 year ago

Hello @adi64 👋 Thanks for raising the issue, and sorry for the late reply - I'm still trailing a bit behind on my emails after my vacation.

Please feel free to take a stab at an implementation, I'd gladly review it and trigger deployment once ready. So anything goes, we could scrape off webspeiseplan.de, or go with the semi-official API from #16, it still seems to be a thing. Whatever fits the bill best ;)

I'll be happy to see a PR flying by!

f4lco commented 1 year ago

Hello @adi64 are you on the topic? If you cannot find the time, could you send another student my way which might take up the project? Thanks!

adi64 commented 1 year ago

Hey, sorry for the late response. As this is a completely different API, I didn't feel like going for it (until now). I now have a somewhat working implementation, see here: https://github.com/adi64/om-parser-webspeiseplan. Also, this thing theoretically works for all other canteens using Webspeiseplan, that's why I changed the repo name. As an example, I added https://iph.webspeiseplan.de/menu (completely unrelated, I just found it online).

It's still WIP though. Some points include

I think it could be cool to get this thing productive as early as possible and then refine and add features iteratively. What do you think?

f4lco commented 11 months ago

@adi64 I am sorry for the late response - feel free to ping if I fall silent for longer. We received another PR #21, I think it's already in good shape. Let's focus on getting something working again - do you think you could base your efforts on that contribution, and tweak & refine in a "step two"?

adi64 commented 10 months ago

Fixed with #21. If there is more, I'll look into working on the current state :)