Last active
May 6, 2024 14:22
-
-
Save dcdunkan/1e57baf2d913b0d93b73fa52edd11df6 to your computer and use it in GitHub Desktop.
Revisions
-
dcdunkan revised this gist
May 6, 2024 . 1 changed file with 10 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ // @match https://*.etlab.in/* // @grant GM_getValue // @grant GM_setValue // @version 0.4 // @author Dunkan <https://github.com/dcdunkan> // @description 3/12/2024, 2:32:52 AM // @run-at document-end @@ -55,4 +55,13 @@ } } } if (window.location.pathname.startsWith("/survey/user/answer/") && Array.from(Array.from(document.getElementsByClassName("answer")).map((x) => Array.from(x.children))).map((x) => x.filter((x) => /Option\[\d+\]/.test(x.name))).flat().length && window.confirm("Do you want to prefill options?")) { let i = 0; let option = 1; do option = Number(window.prompt((i > 0 ? "INVALID input: " : "") + "Enter 1 to 5", "x").trim()), i += 1; while (isNaN(option) || option < 1 || option > 5); Array.from(Array.from(document.getElementsByClassName("answer")).map((x) => Array.from(x.children))).map((x) => x.filter((x) => /Option\[\d+\]/.test(x.name))).map((x) => x[option-1].click()) } })(); -
dcdunkan revised this gist
Mar 11, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ // @match https://*.etlab.in/* // @grant GM_getValue // @grant GM_setValue // @version 0.3 // @author Dunkan <https://github.com/dcdunkan> // @description 3/12/2024, 2:32:52 AM // @run-at document-end -
dcdunkan revised this gist
Mar 11, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ // @match https://*.etlab.in/* // @grant GM_getValue // @grant GM_setValue // @version 0.2 // @author Dunkan <https://github.com/dcdunkan> // @description 3/12/2024, 2:32:52 AM // @run-at document-end -
dcdunkan revised this gist
Mar 11, 2024 . 1 changed file with 5 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -4,9 +4,13 @@ // @match https://*.etlab.in/* // @grant GM_getValue // @grant GM_setValue // @version 0.0 // @author Dunkan <https://github.com/dcdunkan> // @description 3/12/2024, 2:32:52 AM // @run-at document-end // @homepageURL https://gist.github.com/dcdunkan/1e57baf2d913b0d93b73fa52edd11df6 // @updateURL https://gist.github.com/dcdunkan/1e57baf2d913b0d93b73fa52edd11df6/raw/etlab-auto-login.userscript.js // @downloadURL https://gist.github.com/dcdunkan/1e57baf2d913b0d93b73fa52edd11df6/raw/etlab-auto-login.userscript.js // ==/UserScript== (function() { -
dcdunkan revised this gist
Mar 11, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ // @match https://*.etlab.in/* // @grant GM_getValue // @grant GM_setValue // @version 0.2 // @author Dunkan <https://github.com/dcdunkan> // @description 3/12/2024, 2:32:52 AM // ==/UserScript== -
dcdunkan revised this gist
Mar 11, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -17,7 +17,7 @@ // setup credentials const hasSetup = GM_getValue("hasSetup", false); if (!hasSetup) { window.alert("Enter the username and password in the next prompts. Disable the script if you decide to stop using it."); let username = "", password = ""; do username = window.prompt("Username"); while (username.trim() === ""); do password = window.prompt("Password"); while (password.trim() === ""); -
dcdunkan revised this gist
Mar 11, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ // @grant GM_getValue // @grant GM_setValue // @version 0.0 // @author Dunkan <https://github.com/dcdunkan> // @description 3/12/2024, 2:32:52 AM // ==/UserScript== -
dcdunkan revised this gist
Mar 11, 2024 . 1 changed file with 40 additions and 21 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ // ==UserScript== // @name etlab auto login // @namespace Violentmonkey Scripts // @match https://*.etlab.in/* // @grant GM_getValue // @grant GM_setValue // @version 0.0 @@ -11,25 +11,44 @@ (function() { console.log("AUTO-LOGIN USERSCRIPT IS RUNNING!"); // LOGIN PAGE if (window.location.pathname.startsWith("/user/login")) { // setup credentials const hasSetup = GM_getValue("hasSetup", false); if (!hasSetup) { window.alert("Enter the username and password in the next prompts. Disable the script if decide to stop using it."); let username = "", password = ""; do username = window.prompt("Username"); while (username.trim() === ""); do password = window.prompt("Password"); while (password.trim() === ""); GM_setValue("username", username); GM_setValue("password", password); GM_setValue("askEverytime", window.confirm("Do you want me to ask you everytime before I login you automatically? (Choose wisely!)")); GM_setValue("hasSetup", true); window.alert("DONE! Clear this script's storage if you wanna reset all this or change credentials"); } if (localStorage.getItem("triggeredByLogout") === "true") if (!window.confirm("You manually logged out last time. Do you want to use auto-login?")) return; else if (GM_getValue("askEverytime", false)) if (!window.confirm("Use auto-login?")) return; localStorage.removeItem("triggeredByLogout"); console.log("LOGGING IN..."); document.getElementById("LoginForm_username").value = GM_getValue("username", ""); document.getElementById("LoginForm_password").value = GM_getValue("password", ""); document.getElementById("login-form").submit(); console.log("LOGGED IN AUTOMATICALLY as", GM_getValue("username")); } else { const logoutLinks = document.getElementsByTagName("a"); for (const a of logoutLinks) { if (a.pathname === "/user/logout") { const onClick = 'if(window.confirm("Do you want to log out?")){localStorage.setItem("triggeredByLogout","true");window.location.href="' + a.href + '";}'; a.outerHTML = "<button onClick='" + onClick + "'>Logout</button>" break; } } } })(); -
dcdunkan created this gist
Mar 11, 2024 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,35 @@ // ==UserScript== // @name etlab auto login // @namespace Violentmonkey Scripts // @match https://*.etlab.in/user/login* // @grant GM_getValue // @grant GM_setValue // @version 0.0 // @author Dunkan // @description 3/12/2024, 2:32:52 AM // ==/UserScript== (function() { console.log("AUTO-LOGIN USERSCRIPT IS RUNNING!"); // setup credentials const hasSetup = GM_getValue("hasSetup", false); if (!hasSetup) { window.alert("Enter the username and password in the next prompts. Disable the script if decide to stop using it."); let username = "", password = ""; do username = window.prompt("Username"); while (username.trim() === ""); do password = window.prompt("Password"); while (password.trim() === ""); GM_setValue("username", username); GM_setValue("password", password); GM_setValue("askEverytime", window.confirm("Do you want me to ask you everytime before I login you automatically? (Choose wisely!)")); GM_setValue("hasSetup", true); window.alert("DONE! Clear this script's storage if you wanna reset all this or change credentials"); } // domt autologin if (GM_getValue("askEverytime", false) && !window.confirm("Use auto-login?")) return; console.log("LOGGING IN..."); document.getElementById("LoginForm_username").value = GM_getValue("username", ""); document.getElementById("LoginForm_password").value = GM_getValue("password", ""); document.getElementById("login-form").submit(); console.log("LOGGED IN AUTOMATICALLY as", GM_getValue("username")); })();