Laffey-chan / Wilma.Electron

MIT License
1 stars 0 forks source link

WILMA IS BEING RUDE - If you have two accounts in wilma it doesn't work #8

Open jaakop opened 4 years ago

jaakop commented 4 years ago

Because wilma.gradia.fi/overview doesn't work with two accounts. It only works with two accounts when the url is wilma.gradia.fi/!{UID}/overview. But the funniest thing is that this link doesn't work if you only have one account.

ReEEeE

developerfromjokela commented 4 years ago

Yes there's this thing called "roles

developerfromjokela commented 4 years ago

You can detect this by requesting overview and getting account type. passwd means that role account

jaakop commented 4 years ago

I see. I still fail to see how this would help me get the actual accounts if the role is passwd. Do you happen to know some API, where I can get the accounts?

developerfromjokela commented 4 years ago

Yes there is an api, that requires an API key. Standard login disables that API, it needs that API key to function

You can get the API key by either:

If you want, you can check my unoffical wilma documentation how to log in and get roles with this API: https://github.com/developerfromjokela/wilma_daycare_api/wiki/POST-Authentication

If you prefer to stay away from using the API key, when you log in and you have roles, it should show in HTML roles at root: kuva

I think you'll be able to parse them from HTML. Role "slugs" start with /! (i.e. /!027541)

developerfromjokela commented 4 years ago

But if you want the app to work better, I think API is better choice than parsing HTML, because it can just change one day without warnings.

developerfromjokela commented 4 years ago

This API key gives more JSON API functionality like "lesson notes", "exams", etc. as JSON

developerfromjokela commented 4 years ago

Btw, this project is awesome! It's still "under construction", but when it will be done, I think it would be even better than Wilma in browser :smiley:

jaakop commented 4 years ago

Thanks! That wiki helped a lot. I will start implementing these changes to the wilma npm package github

developerfromjokela commented 4 years ago

👍

developerfromjokela commented 4 years ago

I've started writing more detailed API documentation here in this wiki: https://github.com/developerfromjokela/wilma_api/wiki

There's not much right now, but will be in near future