summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/main.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs
index 68e378a..d02e53b 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -5,7 +5,7 @@
 //! This is a simple program capable of parsing VUWs courses from the registry. It cannot correctly
 //! parse prerequisites, however.
 
-use std::collections::HashMap;
+use std::collections::{BTreeMap, HashMap};
 
 use futures_util::future::join_all;
 use scraper::Html;
@@ -19,7 +19,7 @@ use vuw_course_scraper::{parse_document, Course};
 struct JsonExport<'a> {
 	/// [`HashMap`] of all courses.
 	#[serde(borrow)]
-	courses: HashMap<&'a str, Course<'a>>,
+	courses: BTreeMap<&'a str, Course<'a>>,
 }
 
 /// Transforms a URI into a documents text form through a get request.
@@ -49,7 +49,7 @@ async fn main() {
 			["d", "u", "p", "o"]
 				.iter()
 				.map(|directory| {
-					format!("https://service-web.wgtn.ac.nz/dotnet2/catprint.aspx?d=all&t={directory}2025")
+					format!("https://service-web.wgtn.ac.nz/dotnet2/catprint.aspx?d=all&t={directory}2024")
 				})
 				.map(into_document),
 		)
@@ -69,11 +69,13 @@ async fn main() {
 			.expect("maps should reduce into one correctly")
 	});
 
+	let sorted_courses: BTreeMap<&str, Course> = all_courses.into_iter().collect();
+
 	fs::write(
 		"./export-dl.json",
 		task::block_in_place(|| {
 			simd_json::serde::to_string(&JsonExport {
-				courses: all_courses,
+				courses: sorted_courses,
 			})
 			.expect("json should parse correctly")
 		}),