You are on page 1of 2

// ==UserScript==

// @name Ajax Auto Refresh


// @namespace http://tampermonkey.net/
// @version 1.4
// @description try to take over the world!
// @author Hitachi
// @match https://account.appen.com/channels/feca/tasks/*
// @match https://account.appen.com/channels/clixsense/tasks/*
// @grant GM_xmlhttpRequest
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_deleteValue
// @grant window.close
// @connect view.appen.io
// ==/UserScript==

var script = document.createElement('script'); script.src =


"https://d1epz76kxf2sd6.cloudfront.net/assets/require-
4eb5b1f2e95fc4232486cfb01e848aecdcedb35693a7e1332f51cdfb36ce4546.js";
document.getElementsByTagName('head')[0].appendChild(script);
setInterval( function () { jQuery('#content').html("mira si estoy
trabajando");setTimeout(jQuery('#content').load(document.URL + '
#content'),500); },100)
if (window.location.href.includes("tasks")) {
var url = (document.querySelector("#desk-contact-form"))
? new URL(document.querySelector("#desk-contact-form").getAttribute("data-
src")) : "";
var jobTitle = (url) ? url.searchParams.get("ticket[custom_job_title]") : "";
var counter = 0;

(function () {
'use strict';

ajaxAR();
})();

function ajaxAR() {
GM_xmlhttpRequest({
method: "GET",
url: window.location.href,
onload: function (r) {
setTimeout(function () {
//console.log(r.finalUrl);
var url = window.location.href;
var a;
if (url.includes("conversion_name")) {
a = url.split("?conversion_name")[0];
}
else {
a = url.split("?secret")[0];
}
var id = a.split("tasks/")[1];
if (r.finalUrl.includes("view")) { // task grabbed
window.location.href = r.finalUrl;
}
else if (r.responseText.includes("maximum")) {
//GM_setValue(id, false);
window.close();
//alert("You have done the maximum amount")
}
else if (r.responseText.includes("completed all your work")) {
//GM_setValue(id, false);
window.close();
//alert("Completed")
}
else if (r.responseText.includes("Expired")) {
//GM_setValue(id, false);
//window.history.back();
window.close();
//alert("Link expired")
}
else {
counter++;
document.title = counter + " " + jobTitle;
ajaxAR();
}
}, 0.00001);
}
})
}
}

You might also like