Mturk Logout Time

This will show your estimated auto logout time and display a warning when the time drops below 30 minutes.

Tendrás que instalar una extensión para tu navegador como Tampermonkey, Greasemonkey o Violentmonkey si quieres utilizar este script.

You will need to install an extension such as Tampermonkey to install this script.

Necesitarás instalar una extensión como Tampermonkey o Violentmonkey para instalar este script.

Necesitarás instalar una extensión como Tampermonkey o Userscripts para instalar este script.

Necesitará instalar una extensión como Tampermonkey para instalar este script.

Necesitarás instalar una extensión para administrar scripts de usuario si quieres instalar este script.

(Ya tengo un administrador de scripts de usuario, déjame instalarlo)

Necesitará instalar una extensión como Stylus para instalar este estilo.

Necesitará instalar una extensión como Stylus para instalar este estilo.

Necesitará instalar una extensión como Stylus para instalar este estilo.

Necesitará instalar una extensión del gestor de estilos de usuario para instalar este estilo.

Necesitará instalar una extensión del gestor de estilos de usuario para instalar este estilo.

Necesitará instalar una extensión del gestor de estilos de usuario para instalar este estilo.

(Ya tengo un administrador de estilos de usuario, déjame instalarlo)

// ==UserScript==
// @name        Mturk Logout Time
// @version     0.1
// @author      Cristo
// @description This will show your estimated auto logout time and display a warning when the time drops below 30 minutes.
// @description Click on the "HITs available now" area on the top to show time remaining until logout.  Format is in a "hours:minutes" countdown.
// @description The top border changes green when time is below 30 minutes, yellow for 15 minutes and red for 5 minutes.
// @description Timing is based off Amazon's word that logouts are every 12 hours. Results may vary.
// @include     https://www.mturk.com/mturk*
// @include     https://www.amazon.com/ap/signin?o*
// @copyright   2012+, You
// @namespace https://greasyfork.org/users/1973
// ==/UserScript==

if (document.getElementById("subtabs_and_searchbar")) {
var number = timeMachine().replace(":","");
var topBar = document.getElementById("subtabs_and_searchbar");
if (number <= 5){
	topBar.style.cssText = "border-top:#F03C0F 10px solid";
} else if (number <= 15) {
	topBar.style.cssText = "border-top:#D8F029 10px solid";
} else if (number <= 30) {
	topBar.style.cssText = "border-top:#1BDA13 10px solid";
}}
if (document.getElementById("ap_header")) {
    var but = document.getElementById("signInSubmit-input");
    but.addEventListener( "click", function () {
    GM_setValue("timeoflog", new Date().getTime());
    } , false );}
function timeMachine() {
var now = new Date().getTime();
var then = GM_getValue("timeoflog");
var since = now - then;
var timeRem = 4.32e+7 - since;
var rawMins = Math.ceil(timeRem/60000);
var hours = Math.floor(rawMins/60);
var baseMins = rawMins%60;
var redunMins = baseMins.toString();
var mins;
if (redunMins.length < 2){
    mins = "0" + redunMins;
} else {
	mins = redunMins;
}    
var results = hours + ":" + mins;
return results;
}
if (document.getElementsByTagName("td")[7]) {
var handle = document.getElementsByTagName("td")[7];
handle.addEventListener( "click", function () {
var time = timeMachine();
var spany = handle.getElementsByTagName("span")[0];
var bany = handle.getElementsByTagName("b")[0];
var parts = spany.innerHTML.substring(75,88);
bany.innerHTML = time;
bany.style.textAlign = "center";
if (spany.innerHTML.indexOf("Until") == -1){
	spany.innerHTML = spany.innerHTML.replace(parts, "Until Logout");    
}
spany.style.textAlign = "center";
} , false );}