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

Implement client API and parser for "Course Search Selection" #142

Open
aomi opened this issue Feb 1, 2022 · 0 comments
Open

Implement client API and parser for "Course Search Selection" #142

aomi opened this issue Feb 1, 2022 · 0 comments
Labels
feature New feature or request

Comments

@aomi
Copy link
Member

aomi commented Feb 1, 2022

Page: https://www.uvic.ca/BAN1P/bwysched.p_list_sections_chk
This page is a bit weird and it's not trivial so here's the rundown so far.

You need to pass in three form params at minimum to get this to return the search page.

curl -s 'https://www.uvic.ca/BAN1P/bwysched.p_search_fields' -X POST  --data-raw 'term_code=202101&wsea_code=CRED&session_id=0'

term_code is the term to which to search against.
wsea_code is currently unknown what it means or what is valid.
session_id doesn't seem to care what it is as long as it's a number and it is present in the request.

Suggested steps

Start by saving the search page for a given term into the static folder so you can develop against a local version of the page. You'll need to parse all the options the page projects. This will then need to be wrapped into a function that can make requests for this page.

The request to get the results will be something like this:

curl 'https://www.uvic.ca/BAN1P/bwysched.p_course_search' -X POST --data-raw 'wsea_code=CRED&term_code=202201&session_id=1256081&sel_subj=dummy&sel_camp=dummy&sel_sess=dummy&sel_attr=dummy&sel_levl=dummy&sel_schd=dummy&sel_insm=dummy&sel_link=dummy&sel_wait=dummy&sel_day=dummy&sel_begin_hh=dummy&sel_begin_mi=dummy&sel_begin_am_pm=dummy&sel_end_hh=dummy&sel_end_mi=dummy&sel_end_am_pm=dummy&sel_instruct=dummy&sel_open=dummy&sel_resd=dummy&sel_subj=SENG&sel_number=265&sel_camp=&sel_insm=&sel_day=m&sel_day=t&sel_day=w&sel_day=r&sel_day=f&sel_day=s&sel_day=u&sel_begin_hh=0&sel_begin_mi=0&sel_begin_am_pm=a&sel_end_hh=0&sel_end_mi=0&sel_end_am_pm=a&sel_instruct=&sel_schd=&sel_wait=%3C10'

image.png
This page is the reason why we want to support this page. It allows use to gather waitlist information with a single request. We can significantly reduce the number of requests we need to do as a result.

The individual records can be retrieved using a simple GET so here's the result for the top screenshot
https://www.uvic.ca/BAN1P/bwysched.p_display_course?wsea_code=CRED&term_code=202201&session_id=1256081&crn=22766&form_code=CALLLIST
This can be referred as the "Course Details" page. It contains some useful information that we don't have at the moment. Priority on fields we don't already have.

@aomi aomi added the feature New feature or request label Feb 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant