Welcome to MTurk Crowd

Work on Amazon Mechanical Turk, learn from the best, and have fun doing it. Join the crowd today!

Sign Up

Request rate reloader

Discussion in 'Userscripts, Extensions, and Software' started by mordea, Jan 24, 2016.

  1. mordea

    mordea
    Expand Collapse
    Master of a Couple Things

    • Contributor
    Joined:
    Jan 22, 2016
    Messages:
    821
    Likes:
    2,592
    Request rate reloader

    While working on a queue of HITs, I prefer to load them in background tabs and work my way down the line. Even though I have tabs set to open one second apart, some of them are bound to occasionally exceed the request rate threshold. This little script will simply reload any pages on https://www.mturk.com/mturk/* which hit the request rate wall. The script will reload the page 4 seconds after it's initiated (typically once the page has fully loaded).

    Code:
    // ==UserScript==
    // @name         mturk request rate reloader
    // @version      1.0
    // @include      https://www.mturk.com/mturk/*
    // @author       mordea
    // @namespace    mordea
    // @description  Automatically reloads pages which hit the refresh rate wall.
    // @grant        none
    // ==/UserScript==
    
    var content = document.body.textContent || document.body.innerText;
    var hasText = content.indexOf("You have exceeded the maximum allowed page request rate for this website.")!==-1;
    if(hasText){
       setTimeout(function(){
           window.location.reload()
       },4000);
    }
    
     
    Collapse Signature Expand Signature