Last active
October 10, 2018 04:28
-
-
Save moomdate/07a8c89bb31a62524256e67bfb80caf2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var header = Array(); var jsonData = {}; | |
| $("html body table tbody tr td table tbody tr td font a").each(function (i, v) { | |
| header[i] = $(this).attr("href"); | |
| }) | |
| for (var i = 0; i < header.length; i++) { | |
| var data = header[i]; | |
| var courseId = data.split("=")[3].split("&")[0]; | |
| var courseCode = data.split("=")[4].split("&")[0]; | |
| //var courseId = data.split("a"); | |
| if (courseCode.length > 3) { | |
| jsonData[courseCode] = courseId; | |
| } | |
| console.log("\""+`${courseCode}` + "\":\"" + `${courseId}`+"\","); | |
| } //console.log(jsonData); | |
| //========================== | |
| //Fetch id reg.sut.ac.th | |
| //-------------------------- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment