Last active
February 28, 2024 20:22
-
-
Save aleister1102/7fc412b096e205224842762ef3723793 to your computer and use it in GitHub Desktop.
Script camp đăng ký học phần sử dụng Tampermonkey
This file contains 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 expectedCourses = {CSC11002: "20_4",CSC15002: "20_22"} | |
var interval = 10 | |
function register() { | |
const courses = document.querySelectorAll("table:not(#tbDSDaDK) tbody tr") | |
const submit = document.querySelectorAll("input[type='submit']")[1] | |
function selectExpectedCourses() { | |
let found = false | |
courses.forEach((course) => { | |
const id = course.querySelector("td:nth-of-type(1)").textContent.trim() | |
const classId = course.querySelector("td:nth-of-type(3)")?.textContent.trim() | |
const checkbox = course.querySelector("td:last-of-type").querySelector("input[type='checkbox']") | |
if (id in expectedCourses && classId === expectedCourses[id] && checkbox) checkbox.checked = found = true | |
}) | |
return found | |
} | |
if (selectExpectedCourses()) submit.click() | |
} | |
register() | |
setTimeout(() => window.location.reload(), interval * 1000) |
Lưu ý 1: để đánh nhanh thắng nhanh, bạn nên chuẩn bị trước một ngày bạn nhé 😉.
Đồng thời, nếu trang web bạn sử dụng để thiết lập tool là portal#
(với #
là từ 1 đến 6), bạn cần sử dụng portal#
khi đăng ký.
Hoặc nếu bạn rảnh thì bạn tạo script hết tất cả các trang từ 1 đến 6 cho rồi 🤷♀️.
Lưu ý 2: mỗi lần đăng ký thì web sẽ tự động hỏi "Bạn có muốn đăng ký không", bạn cần phải bấm cái này bằng tay vì trình duyệt không cho phép tool làm dùm 🥹
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hướng dẫn xài tool
Thực hiện các bước sau để có một ngày đăng ký học phần xinh đẹp tuyệt vời 🌹:
CSC11002
và mã lớp là20_4
: bạn sẽ ghi làCSC11002: "20_4"
.