Mturk Logout Time

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

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==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 );}