Gbr22 / edu

Timetable mobile app for any school using edupage.
https://play.google.com/store/apps/details?id=sh.kess.edu
GNU General Public License v3.0
2 stars 1 forks source link

Substitutions #1

Closed fucksophie closed 8 months ago

fucksophie commented 9 months ago

Hello, this app is absolutely great but substitutions don't seem to be implemented? It's the only part of this app that I'm missing!

Gbr22 commented 9 months ago

Hi! Sure, if it is possible within the bounds of the edupage API I would be apply to add that as a feature!

Just so we are on the same page by substitutions you mean that when the usual teacher for a class cannot show up (for some reason) and a substitute teacher is scheduled for the lesson you have that information visible on your school's edupage timetable site?

fucksophie commented 9 months ago

It is possible within the Edupage API. Unfortunately however it returns HTML. JSDom and other HTML parsing libraries will not work on React, use Cheerio. I'll get back to you with the endpoint in a second.

Yes, I mean those substitutions. They also contain if a class is not happening and more. The changes for timetables. This information structure however changes between schools (iirc), and I do not think it would be easy to merge the substitutions with the timetable.

Gbr22 commented 9 months ago

I'm not really a fan of web scraping / html parsing. I've used that approach in an old (now archived) timetable app and it had many issues. But if you say that the info shows up on the website then it will probably be accessable via the API. The HTML of the website is rendered on the client site from the information provided by the API.

image

Perhaps it could be in classroomsupervisions? I wouldn't know as I haven't found a school that uses this feature, so for me it would always be an empty array. Could you give me your school's http://*.edupage.org URL? If you don't want to share it publicly you can message me on discord at .kess. (the dots are important). I want to examine the reponse of https://<school_id>.edupage.org/timetable/server/regulartt.js?__func=regularttGetData

fucksophie commented 9 months ago

What I'm saying is that the API endpoint returns HTML. I've added you on discord. I've never actually seen classroomsupervisions in our edupage at all. If I remember correctly, viewer.js had a argument combination which returns JSON such as { r: "<div..." }.

Gbr22 commented 8 months ago

Feature implemented in v1.1.0 (0971edc)