[Script] "Other" Sergey - Rate TV Show & Movie keywords

Discussion in 'mTurk Scripts & Resources' started by ceedj, Feb 7, 2017.

  1. ceedj

    ceedj Survey Slinger

    Messages:
    2,767
    Gender:
    Male
    Ratings:
    +6,020
    Here's one for the "other" Sergey for the Rate TV Show & Movie keywords HIT, AND the Pairs HIT. Anyway, it focuses on the first choice, no need to collapse the instructions, though you still can if you want to. Will cycle through all three answers as you go; press keys 1-5 (1-4 on the Pairs HIT) on the top row or numpad, and Enter to submit. Keys 4 and 5 disabled on question 3 (just 5 on Q3 for the Pairs HIT). Standard "don't blame me" disclaimer applies. Have fun!

    EDIT: 1.2 adds the formerly "broken" pairs HIT, should now work with both.

    Code:
    // ==UserScript==
    // @name         Other Sergey Rate Tags ($0.05)
    // @namespace    none
    // @version      1.2
    // @description  Sploosh!
    // @author       ceedj
    // @include      https://s3.amazonaws.com/*
    // @include      https://www.mturkcontent.com/*
    // @grant        GM_log
    // @require      http://code.jquery.com/jquery-2.1.1.min.js
    // ==/UserScript==
    
    var Sanity = $('p:contains(Rate the accuracy)');
    var Sanity2 = $('li:contains(Pairs TV Shows or Movies)');
    if (Sanity.length || Sanity2.length){
    $("#submitButton").css('display','block');
        if(Sanity2.length){
        var QNumber = 0;
        var Kids = "suggestion1";
        var Rela = "suggestion2";
        var Matu = "suggestion3";
        var QChoice = Kids;
        $("input[name='suggestion1']")[0].focus();
        } else
        {var QNumber = 0;
        var Kids = "is_kids_tag";
        var Rela = "is_relevant";
        var Matu = "title_too_mature";
        var QChoice = Kids;
    $("input[name='is_kids_tag']")[0].focus();}
    $(document).ready(function() {
    window.focus();
    });
    
    
    
    document.onkeydown = function(e) {
    
    
    if (e.keyCode === 49 || e.keyCode === 97 ){
        $("input[name="+QChoice+"]")[0].click();
        QNumber++;
        }
    
    if (e.keyCode === 50 || e.keyCode === 98 ){
        $("input[name="+QChoice+"]")[1].click();
        QNumber++;
        }
    
    if (e.keyCode === 51 || e.keyCode === 99 ){
        $("input[name="+QChoice+"]")[2].click();
        QNumber++;
        }
    
    if (e.keyCode === 52 || e.keyCode === 100 ){
        $("input[name="+QChoice+"]")[3].click();
        if (QNumber === 3 && Sanity.length)
        {$("input[name='title_too_mature']")[0].focus();
        QNumber = 3;
        } else {QNumber++;}
        }
    
    if (e.keyCode === 53 || e.keyCode === 101 ){
        $("input[name="+QChoice+"]")[4].click();
        if (QNumber === 3 && Sanity.length)
        {$("input[name='title_too_mature']")[0].focus();
        QNumber = 3;
        } else {QNumber++;}
        }
    
    
    switch (QNumber){
            case 1:
            if (Sanity2.length){
            $("input[name='suggestion2']")[0].focus();}
            else
            {$("input[name='is_relevant']")[0].focus();}
            QChoice = Rela;
            break;
            case 2:
            if (Sanity2.length){
            $("input[name='suggestion3']")[0].focus();}
            else
            {$("input[name='title_too_mature']")[0].focus();}
            QChoice = Matu;
            break;
            case 3:
            if (Sanity2.length){
            $("input[name='suggestion1']")[0].focus();}
            else
            {$("input[name='is_kids_tag']")[0].focus();}
            QChoice = Kids;
            QNumber = 0;
            break;
        }
    
            //Submit
    if (e.keyCode === 13) { // Enter or NumpadEnter
    $("input[id='submitButton']").click();
    }
    } ;
    }
    
     
    • Love Love x 2
    Last edited: Feb 9, 2017
  2. turk_it

    turk_it Survey Slinger

    Messages:
    3,728
    Gender:
    Male
    Ratings:
    +10,147
    Thanks, Man! Much appreciated!
     
    • Like Like x 1
  3. ceedj

    ceedj Survey Slinger

    Messages:
    2,767
    Gender:
    Male
    Ratings:
    +6,020
    Well, a day or so after I emailed the "other" Sergey about how his code was wonky, it got fixed. So this script will support the formerly broken HIT very soon.

    EDIT: Now live, above, 1.2 adds the formerly "broken" pairs HIT, should now work with both.
     
    • Like Like x 1
    Last edited: Feb 9, 2017
  4. RicanGuy86

    RicanGuy86 Survey Slinger

    Messages:
    4,452
    Ratings:
    +9,138
    Mah man doing overtime. :emoji_punch:
     
    • Like Like x 1