searching for departments fixed using UT Review api 🤪
This commit is contained in:
@@ -204,17 +204,16 @@ function getCurrentSemesters() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getCurrentDepartments() {
|
function getCurrentDepartments() {
|
||||||
$.get("https://catalog.utexas.edu/undergraduate/appendix-b/", function (response) {
|
$.get("https://www.utexasreview.com/api/get_major", function (response) {
|
||||||
if (response) {
|
if (response) {
|
||||||
departments = [];
|
console.log("getCurrentDepartments -> response", response);
|
||||||
htmlToNode(response)
|
let { majors } = response;
|
||||||
.find(".column1")
|
let indices = Object.keys(majors);
|
||||||
.each(function (i) {
|
let new_departments = [];
|
||||||
if (i > 1) {
|
for(let i = 0; i<indices.length; i++){
|
||||||
let abv = $(this).text();
|
new_departments.push(majors[i].abr);
|
||||||
departments.push(abv);
|
|
||||||
}
|
}
|
||||||
});
|
departments = new_departments;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user