[Script] mTurk HIT Page Improvement...thingy...doo-dad...

Discussion in 'mTurk Scripts & Resources' started by ceedj, Dec 13, 2017.

  1. ceedj

    ceedj Survey Slinger

    Messages:
    2,767
    Gender:
    Male
    Ratings:
    +6,020
    EDIT: 2/19/2018 - This script is now obsolete. I'll leave it posted for anyone who wants to learn off of it.

    Ok, not sure what to call it, but for now, it's HIT Page Improvements, and not the much voted upon Crap That took WAY too long.

    [​IMG]

    This script hopes to improve the Amazon Mechanical Turk user experience, in ways that the company themselves is not likely to achieve. In this script, the HITs available amount and a (working!) contact requester link is on the HIT page itself, accepted or not. Nothing major here, just some fancy (for me) fiddling with strings. Any other ideas may get slapped onto this in the future, but for now, enjoy!

    Code:
    // ==UserScript==
    // @name         HIT Page Improvements
    // @namespace    None
    // @version      1.1
    // @description  Go back to Toronto! I'M FROM WINNIPEG YOU IDIOT!
    // @author       ceedj
    // @include      *.mturkcontent.com/*
    // @include      https://worker.mturk.com/projects*
    // @grant        GM_log
    // @require      https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js
    // ==/UserScript==
    
    $(document).ready(function(){
        var tempStart = $("div[data-react-props]").prop('outerHTML');
        var tempStart1 = (tempStart) ? tempStart.split("assignableHitsCount")[1]: "";
        var tempSearch1 = (tempStart1) ? tempStart1.split(",")[0]: "";
        var HITsLeft = (tempSearch1).slice(7);
        var tempStart2 = $("div[data-react-props]").prop('outerHTML');
        var tempStart3 = (tempStart2) ? tempStart2.split("contactRequesterUrl")[1]: "";
        var tempSearch2 = (tempStart3) ? tempStart3.split(",")[0]: "";
        var tempSearch3 = (tempSearch2).slice(13, -6);
        var tempSearch4 = (tempSearch3).replace(/u0026/g,"");
        var ReqUrl = (tempSearch4).replace(/\\/g,'&');
        $("span[class='detail-bar-value']:first").append($("<div class='col-xs-5 col-md-6 text-md-right'>").append($("<a href='" + ReqUrl + "' target='_blank'/>").html("Contact Requester")));//Contact
        $("span[class='detail-bar-value']:last").append($("<div class='col-xs-5 col-md-6 text-md-right'>").html("HITs Available: ").append(HITsLeft));//HITs
    });
    
     
    • Like Like x 3
    • Today I Learned Today I Learned x 2
    • Love Love x 1
    Last edited: Feb 19, 2018
  2. ceedj

    ceedj Survey Slinger

    Messages:
    2,767
    Gender:
    Male
    Ratings:
    +6,020
    Please update ASAP. It had an error, and caused other scripts to error, but it still worked, so I never noticed it. Code below is updated, please do so. Sorry if this caused any hassle!
     
  3. lefty

    lefty Survey Slinger

    Messages:
    18,930
    Gender:
    Female
    Ratings:
    +49,005
    contact requester doesn't seem to work anymore ceedj
     
  4. ceedj

    ceedj Survey Slinger

    Messages:
    2,767
    Gender:
    Male
    Ratings:
    +6,020
    Yeah, I'm likely not doing anything with this anymore, since mTurk actually shocked us all by fixing most of the issues this script solved. So I'll suggest dumping it at this time, since you can still get the contact link from the popup.
     
    • Like Like x 1