msramalho / SigTools

📆 Sigarra Tools | An extension that makes the information system of the University of Porto slightly better.
https://chrome.google.com/webstore/detail/sigarra-to-calendar/piefgbacnljenipiifjopkfifeljjkme
Apache License 2.0
37 stars 0 forks source link

Option for fetching more details for Moodle events #49

Open fabiodrg opened 5 years ago

fabiodrg commented 5 years ago

Not every events information is embedded in HTML page, which is unfortunate for us. However, there are some calls that we can make for fetching more details regarding the event. An example is the course name, which in the HTML is an ugly course identifier and academic year, e.g. FEUP-EIC0085_EBE0235-2018/2019-META-2S :nauseated_face:. If you use the calls we could fetch the course name, e.g. Laboratório de Bases de Dados e Aplicações Web :smile:. Other things like a more detailed description are available in the response.

There are at least two APIs we can use (both using POST methods)

How can we get the session key?

Well, there's a global JavaScript variable, which is an object and has the property sesskey which holds the session key value. It's as simple as this: M.cfg.sesskey

How to use core_calendar_get_calendar_monthly_view ?

Still investigating... :eyes:

How to use core_calendar_get_calendar_event_by_id ?

Still investigating... :eyes: