Last active
May 18, 2023 16:14
-
-
Save belidzs/613fc38ec401922b1db56a2443a57a4f to your computer and use it in GitHub Desktop.
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
// ==UserScript== | |
// @name egeszsegkonyha.hu IPA helper | |
// @namespace Violentmonkey Scripts | |
// @match https://egeszsegkonyha.hu/index.php/etlapunk | |
// @grant none | |
// @version 1.0 | |
// @author Balazs Keresztury | |
// @description 3/2/2023, 4:20:51 PM | |
// ==/UserScript== | |
function fillOut(pointsPerAnswer = 10) { | |
let points = 0; | |
for (let select of document.forms[0].getElementsByTagName("select")) { | |
if (select.name === "ipa_answer_support[0]") { | |
console.debug(`Skipping ${select.name}`); | |
continue; | |
} | |
console.debug("Next question: " + select.name); | |
ipa_answer(select.parentElement.children[11], 10); | |
points += pointsPerAnswer; | |
} | |
return points; | |
} | |
if (document.forms.length == 2) { | |
console.info("egeszsegkonyha.hu IPA helper will now try to fill out the survey for you."); | |
let points = fillOut(); | |
console.info(`Done. Will receive ${points} points.`); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment