loumadev / EdupageAPI

Simple node.js package to manage your EduPage account.
GNU General Public License v3.0
24 stars 2 forks source link

Getting timetables for classes, students and teachers not just "My Timetable" #16

Open cfpwastaken opened 2 years ago

cfpwastaken commented 2 years ago

Yeah would be pretty cool to have, especially for my edupage discord bot as it currently shows my timetable to all students in my class who might have slightly different timetables. Also i think this might be very easy to implement. There should be some kind of InsufficientPermission exception for when you do not have permission to see a timetable.

loumadev commented 2 years ago

I looked it up, and it turned out it isn't that easy to implement. The only thing I can get from EduPage is a few megabytes large JSON object with all the data divided into arrays. So to implement it properly, I have to make the whole parser/generator to create the final timetable (like on original EduPage site). I have currently no free time, but I will try to make it run (don't know when though).

cfpwastaken commented 2 years ago

I looked it up, and it turned out it isn't that easy to implement.

bruh

I have currently no free time, but I will try to make it run (don't know when though).

Ok.

ivanhrabcak commented 2 years ago

image

Can this be used?

loumadev commented 2 years ago

Unfortunately no, but actually, under the hood it uses the same data (so it wouldn't help, it would even harder to optain that data).

ivanhrabcak commented 2 years ago

I've been able to implement this with this endpoint: https://{subdomain}.edupage.org/server/currenttt.js?__func=curentttGetData - it returns JSON.

If your school setup in such way that you don't see the timetables of other people, it won't work obviously, but I think this is the easiest way to implement this and it should work for everyone (if school is setup correctly).

Code from edupage-api

cfpwastaken commented 2 years ago

actually, when I go to that url with my schools subdomain it goes to 404.edupage.org

BelKed commented 2 years ago

@cfpwastaken Same result for me – your school probably doesn't have enabled viewing timetables of other people. Also, you have to send a POST request to these endpoints...

But you can use it like this to view timetables in a browser:

https://{subdomain}.edupage.org/timetable/view.php?student={student_id}
https://{subdomain}.edupage.org/timetable/view.php?teacher={teacher_id}
https://{subdomain}.edupage.org/timetable/view.php?class={class_id}
https://{subdomain}.edupage.org/timetable/view.php?classroom={classroom_id}
https://{subdomain}.edupage.org/timetable/view.php?num={timetable_id}
cfpwastaken commented 2 years ago

your school probably doesn't have enabled viewing timetables of other people.

My school has that disabled too. But my school has enabled viewing timetables for classes