Skip to content

Commit

Permalink
Update classes.wtf for 2024-2025 year
Browse files Browse the repository at this point in the history
  • Loading branch information
ekzhang committed Sep 7, 2024
1 parent 40de058 commit a68ea4a
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ RUN npm ci
COPY . .
RUN npm run build

FROM golang:1.20-bookworm AS builder
FROM golang:1.22-bookworm AS builder
WORKDIR /go/app
COPY . .
RUN go build -buildvcs=false

FROM redis/redis-stack-server:7.0.6-RC8 AS redis-stack

FROM redis:7-bookworm
FROM redis:7.0-bookworm
RUN ln -sf /bin/bash /bin/sh
RUN apt-get update && apt-get install -y ca-certificates procps && apt-get clean
COPY --from=redis-stack /opt/redis-stack/lib/redisearch.so /opt/redis-stack/lib/redisearch.so
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ This loads data from Curricle for academic terms before Spring 2022 (AY 2022) an
go run . download -year 2019 # -> data/courses-2019.json
go run . download -year 2020 # -> data/courses-2020.json
# ... and so on
go run . download -year 2024 # -> data/courses-2024.json
go run . download -year 2025 # -> data/courses-2025.json
```

Unfortunately, My.Harvard does not allow you to view courses from previous academic years, so years between 2023 and the current one will probably not return any data. For those, you can download the appropriate preloaded datasets from our [public S3 bucket](https://s3.amazonaws.com/classes.wtf).
Expand Down
2 changes: 2 additions & 0 deletions datasource/myharvard.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ func (s *SearchMh) request(page uint) (props map[string]any, results map[string]
// Example: 2024 selects Fall 2023 and Spring 2024.
func mhGetYearFilter(year int) (yearFilter string, err error) {
switch year {
case 2025:
yearFilter = `(STRM:"2248" | STRM:"2252")`
case 2024:
yearFilter = `(STRM:"2238" | STRM:"2242")`
case 2023:
Expand Down
10 changes: 5 additions & 5 deletions frontend/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
let landing = query === "";
$: if (query) landing = false;
let ay2024 = true;
let currentYear = true;
let genEdChecks: boolean[] = new Array(4).fill(false);
let genEdAreas: string[] = ["HSI", "STS", "EC", "AC"];
Expand Down Expand Up @@ -60,7 +60,7 @@
// Add relevant year/gen-ed tags to query, if boxes checked.
finalQuery =
(ay2024 ? "@academicYear:[2024 2024] " : "") +
(currentYear ? "@academicYear:[2025 2025] " : "") +
normalizeText(query) +
(genEdQuery ? genEdSearchQuery : "");
Expand Down Expand Up @@ -112,7 +112,7 @@
<p>
Filter by specific attributes like
<QueryLink bind:query value={`@subject:compsci`} />,
<QueryLink bind:query value={`@semester:"fall 2023"`} />, and
<QueryLink bind:query value={`@semester:"fall 2024"`} />, and
<QueryLink bind:query value={`@level:{graduate}`} />.
</p>
<p>
Expand Down Expand Up @@ -167,8 +167,8 @@

{#if !landing}
<label class="flex items-center text-sm mb-2">
<input class="mr-2" type="checkbox" bind:checked={ay2024} />
Only show AY 2023–2024 courses
<input class="mr-2" type="checkbox" bind:checked={currentYear} />
Only show AY 2024–2025 courses
</label>
{/if}

Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func Run(uri string, static string, local bool) {
if local {
exec.Command("docker", "kill", "classes.wtf-redis").Run()
proc = exec.Command("docker", "run", "--name", "classes.wtf-redis",
"-i", "--rm", "-p", "7501:6379", "redis/redis-stack-server:latest",
"-i", "--rm", "-p", "7501:6379", "redis/redis-stack-server:7.0.6-RC8",
"redis-stack-server", "--save", "")
} else {
proc = exec.Command("redis-server",
Expand Down

0 comments on commit a68ea4a

Please sign in to comment.