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

Implementing Oputibamu API #40

Open
Oreeeee opened this issue Sep 19, 2024 · 4 comments
Open

Implementing Oputibamu API #40

Oreeeee opened this issue Sep 19, 2024 · 4 comments

Comments

@Oreeeee
Copy link

Oreeeee commented Sep 19, 2024

I've made a library that parses the timetable, and exposes it as a JSON API. It returns the timetable as one JSON response, which aside from the obvious thing like the lesson, differentiates between groups (allowing to easily add a group chooser to the timetable), gives the replacement data straight up in the lesson field, and gives the info about the temporary PRz classrooms (the building and the room number). From the planned features there is adding a short lessons bool to the response, and mapping the shortened names of subjects to their full ones (for example, "pr.urz.techn" will be mapped to "pracownia urządzeń techniki komputerowej" like it is in the register clients). For now, the API would have to be hosted somewhere else (or interfaced directly using Go), but it might get moved to being hosted on the school server once it gets principal's approval (and to get approved, we need to have a client actually using the API). Hosting the API would also allow other people to make timetable frontends easily.

https://github.com/Oreeeee/oputibamu
https://github.com/Oreeeee/oputibamu-api

I will provide the API documentation (it's really simple), if you are interested in implementing this, I might also help with adding this.

@rico-et22
Copy link
Owner

rico-et22 commented Sep 19, 2024

Hello,
A more friendly way to access the timetable that wouldn't need this app to parse the tables by itself is appreciated, but without any docs for this API, I can't tell if it's a good solution for this project, especially as it "returns the timetable as one JSON response" - returning the whole timetable for all classes, rooms etc. at once will have a significant impact on performance and require architectural changes (right now every class etc. is a separate cached route with incremental static regeneration). I think such changes will be too much time-consuming for me, if I did them by myself only, as I left Elektronik a year ago, have a job & pursue a degree, and now I don't have time to be responsible 24/7 for a breaking change for 1,000+ students there .
Most of the features you're mentioning are already implemented. If you manage to get some react devs to fork this repo and propose a good refactor using your Oputibamu API in line with Next.js/ISR principles, then feel free to open a PR with a change to your API, but before, please test it :)

@Oreeeee
Copy link
Author

Oreeeee commented Sep 19, 2024

I might have worded the "returns the timetable as one JSON response" a bit wrong, as I meant that it returns the table for one class per route, with all the nescessary stuff already in there. The response for the timetable looks like this: 11.json. The API is subject to change, and the day property is broken right now.

@Oreeeee
Copy link
Author

Oreeeee commented Oct 1, 2024

Should the API return just raw timetable, array of rows of the timetable, or columns for every day? I don't know how how the current scraper does this.

@rico-et22
Copy link
Owner

It's like this:
image

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

2 participants