Attempts to record tasks submitted to kikora and delivers the correct results to everyone else
当前为
// ==UserScript==
// @name Kikora hax
// @namespace Danielv123
// @version 0.3
// @description Attempts to record tasks submitted to kikora and delivers the correct results to everyone else
// @author You
// @match *.kikora.no/*
// @require http://code.jquery.com/jquery-3.1.0.js
// @grant none
// ==/UserScript==
url = document.location.href.replace("HWA|", "").replace("|", "/").replace("|", "/").split(/[/:]+/);
console.log(url);
console.log("Book: " + url[7] + " Theme: " + url[8] + " Chapter: " + url[9] + " Task: " + url[10]);
function wasddas(number) {
number = number - 1;
(function(number){
url = document.location.href.replace("HWA|", "").replace("|", "/").replace("|", "/").split(/[/:]+/);
$.ajax({
type: "POST",
url: "/k/json",
data: 'request={"solution":{"containerid":"'+url[9]+'","exerciseid":'+url[10]+',"timeusedforevent":'+666+',"calculationid":0,"solutionid":' + number + ',"newcalculation":false,"lcode":"nb"}}',
dataType: "json",
success: function(data) {
if(data[0].solution){
console.log(number);
console.log("Hint found!");
console.log(data[0].solution.esl);
} else {
console.log("Not found :'(");
if (number>-10){
wasddas(number);
}
}
},
error: function() {
// alert('error handing here');
}
});
})(number);
}
// start it up
setInterval(function(){
wasddas(30);
}, 5000);