// ==UserScript== // @name Live Hack Quizlet // @namespace Nguyễn Văn Cao Kỳ // @description :) // @author Nguyễn Văn Cao Kỳ // @include *quizlet.com/live* // @require https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js // @grant GM_xmlhttpRequest // @grant GM.xmlHttpRequest // @grant GM_getResourceText // @grant GM_getValue // @grant GM_setValue // @grant unsafeWindow // @grant none // @version 1.0.2 // @copyright 2021, nguyenvancaoky (https://fb.me/nguyenvancaoky) // @license MIT // ==/UserScript== appendMenu(); appendFunc(); function appendMenu(){ var divBlock = ``; $("body").append(divBlock); } function appendFunc(){ var func = document.createElement("script"); func.innerHTML = `let terms=[],definitions=[],qs="",autoClick=!1,color=!0,menu=!0;function Turn_on_hack(){getQuizletCode(inputCode())}function showStatus(){let t="AUTO: "+autoClick+" | COLOR: "+color;$("#log").text(t),console.log(t)}function Log(t){$("#log").text(t),console.log(t)}function inputCode(){let t=[];for(var e=0;e<6;e++)t[e]=$(".StudentGameCodeInput-inner input:eq("+e+")").val();let n=t.toString();return Log("GET INPUT ----> "+(n=n.split(",").join(""))),n}function getQuizletCode(t){fetch("https://quizlet.com/webapi/3.8/multiplayer/game-instance?gameCode="+t).then(t=>t.text()).then(t=>{t=(t=JSON.parse(t)).gameInstance.itemId,window.quizletCode=t;Log("GET CODE ----> "+t),appendJson()})}function getAnswer(){result=JSON.parse($("#answerJson").text()),window.questions=result,Log("LOAD JSON ----> 100%"),parseQuestions()}function appendJson(){$("#answerJson").remove(),fetch("https://quizlet.com/"+window.quizletCode+"/").then(t=>t.text()).then(t=>{Log("LOAD ANSWER ----> 100%");let e=t.split("")[0]).split("QLoad(")[0]).split('(function(){window.Quizlet["setPageData"] = ')[1]).slice(0,-2))).termIdToTermsMap),$("body").append(""),$("#answerJson").append(e),getAnswer()})}function parseQuestions(){let t=window.questions,e=Object.keys(t);terms=[],definitions=[];for(let n=0;n OK') }