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

Support Winter 2024 courses in Hotseat! #113

Merged
merged 2 commits into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions docs/adding-a-term.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Adding a term

1. Scrape the enrollment appointments
2. Scrape the subject areas, courses, and sections

## Scrape the enrollment appointments

Every quarter, the UCLA registrar publishes the enrollment appointments for the next quarter. We download this page/file manually and scrape it in order to calculate when enrollment is.

Check out the enrollment appointment [readme](/lib/scrapedata/enrollment_appointments/README.md) for more detail on how to download and scrape this file.

## Scrape the subject areas, courses, and sections

Go to the `lambdas/` directory and update the `currentTerm` payload to match the new term. Make sure that the `term` and `id` match the database!

Once this update is made, run `make deploy` to deploy the lambdas on the new schedule. You may also want to run `fetch-subject-areas` and `fetch-courses` manually so that `fetch-sections` has all the data it needs on a run.
4 changes: 2 additions & 2 deletions lambdas/default-event.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"term": {
"term": "23F",
"id": 75
"term": "24W",
"id": 76
},
"shouldInsertEnrollmentData": true
}
22 changes: 11 additions & 11 deletions lambdas/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ custom:
# Payloads
currentTerm:
term:
term: '23F'
id: 75
term: '24W'
id: 76
shouldInsertEnrollmentData: true
summerTerm:
term:
Expand All @@ -61,9 +61,9 @@ functions:
- schedule:
rate: cron(15 23 1 * ? *)
input: ${self:custom.currentTerm}
- schedule:
rate: cron(15 23 1 * ? *)
input: ${self:custom.summerTerm}
# - schedule:
# rate: cron(15 23 1 * ? *)
# input: ${self:custom.summerTerm}

FetchCourses:
name: fetch-courses
Expand All @@ -74,9 +74,9 @@ functions:
rate: cron(45 23 * * ? *)
input: ${self:custom.currentTerm}
# Every day at 11:50pm UTC
- schedule:
rate: cron(50 23 * * ? *)
input: ${self:custom.summerTerm}
# - schedule:
# rate: cron(50 23 * * ? *)
# input: ${self:custom.summerTerm}

FetchSections:
name: fetch-sections
Expand All @@ -88,9 +88,9 @@ functions:
rate: cron(25 * * * ? *)
input: ${self:custom.currentTerm}
# Every hour at XX:35
- schedule:
rate: cron(35 * * * ? *)
input: ${self:custom.summerTerm}
# - schedule:
# rate: cron(35 * * * ? *)
# input: ${self:custom.summerTerm}

FetchCourseDescriptions:
name: fetch-course-descriptions
Expand Down
293 changes: 293 additions & 0 deletions lib/scrapedata/enrollment_appointments/Fall 2023-Winter 2024.html

Large diffs are not rendered by default.

284 changes: 0 additions & 284 deletions lib/scrapedata/enrollment_appointments/Fall 2023.html

This file was deleted.

2 changes: 1 addition & 1 deletion lib/tasks/scrape.rake
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ enrollment_appointments_map = T.let(
"2020" => "lib/scrapedata/enrollment_appointments/Fall 2020-Spring 2021.html",
"2021" => "lib/scrapedata/enrollment_appointments/Fall 2021-Spring 2022.html",
"2022" => "lib/scrapedata/enrollment_appointments/Fall 2022-Spring 2023.html",
"2023" => "lib/scrapedata/enrollment_appointments/Fall 2023.html",
"2023" => "lib/scrapedata/enrollment_appointments/Fall 2023-Winter 2024.html",
},
T::Hash[String, String],
)
Expand Down
Loading