Skip to content

Instantly share code, notes, and snippets.

@belidzs
Last active May 18, 2023 16:14
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 belidzs/613fc38ec401922b1db56a2443a57a4f to your computer and use it in GitHub Desktop.
Save belidzs/613fc38ec401922b1db56a2443a57a4f to your computer and use it in GitHub Desktop.
// ==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