Skip to content

Instantly share code, notes, and snippets.

@jurgenzz

jurgenzz/csdd.js Secret

Last active November 26, 2020 17:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jurgenzz/1fdf0e5c3753b37020ddb9a1be11c4c0 to your computer and use it in GitHub Desktop.
Save jurgenzz/1fdf0e5c3753b37020ddb9a1be11c4c0 to your computer and use it in GitHub Desktop.
Looking for free times in csdd exams
// run using cjs chrome extension
// navigate to desired exam (following the steps in https://e.csdd.lv/examp/)
// > client center (e.g. Rigas KAC)
// > type (kvalifikācijas iegūšana)
// > category (B)
// as most of the times, there are available exams ~ 1 month from today with 5+ available spaces
// this script simply keeps refreshing and checking when "1" place is available
// this happens, when someone cancels their appointment
// an alert is then presented and script stops it's execution
$(document).ready(() => {
let found = false
let rightSection = false
$('#datums').children().map((i, option) => {
let text = option.innerText;
console.log(text)
if (text.slice(-2) === ' 1' && i < 13) {
found = text
}
rightSection = true
})
if (found) {
alert(found)
} else {
if (!rightSection) {
return;
}
setTimeout(() => {
!found && $('#find').click()
}, 5000)
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment