Using new endpoint, no description sometimes
williamyeny opened this issue · 2 comments
It seems like a few courses return an empty response when calling the regblocks endpoint. In that case, we need to check if unable to get description, and if so, call the previous non-regblocks endpoint.
Update: I have discovered it is the courses with "topics" (blue links underneath the course in the class search) that break this because you need to specify which topic in the URL.
For example, if a course "ABC" has topic "x", you have to call "https://.../ABC/x", not just "https://.../ABC".
I will see if I can extract the topic ID from DukeHub. If I can't, I will use the method discussed in the initial comment
Fixed by checking if it contains the Topics div, and if so, use the old endpoint.
In the future, I would like to have individual buttons for each topic to view their description.
However, since Schedule Builder uses the topic's ID and the topic's ID is not exposed in the HTML, we need to do an additional request to find that ID.