-
-
Save jurgenzz/1fdf0e5c3753b37020ddb9a1be11c4c0 to your computer and use it in GitHub Desktop.
Looking for free times in csdd exams
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
// 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