From b0188437fb329c033d57ab0c4a8cfb29c606a477 Mon Sep 17 00:00:00 2001 From: sghsri Date: Wed, 26 Aug 2020 15:03:08 -0500 Subject: [PATCH] =?UTF-8?q?searching=20for=20departments=20fixed=20using?= =?UTF-8?q?=20UT=20Review=20api=20=F0=9F=A4=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/background.js | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/js/background.js b/js/background.js index 065f12d8..2aa507f1 100644 --- a/js/background.js +++ b/js/background.js @@ -204,17 +204,16 @@ function getCurrentSemesters() { } function getCurrentDepartments() { - $.get("https://catalog.utexas.edu/undergraduate/appendix-b/", function (response) { + $.get("https://www.utexasreview.com/api/get_major", function (response) { if (response) { - departments = []; - htmlToNode(response) - .find(".column1") - .each(function (i) { - if (i > 1) { - let abv = $(this).text(); - departments.push(abv); - } - }); + console.log("getCurrentDepartments -> response", response); + let { majors } = response; + let indices = Object.keys(majors); + let new_departments = []; + for(let i = 0; i