1. Glad you stopped in for a visit!

    Please feel free to peruse around and if you have a minute make sure to sign up for an account! We're one of the largest, most active, and helpful communities you'll find for learning about mTurk & registered accounts automatically get access to tons of useful features on the site.

    Features for members include:

    • The ability to post messages - our community is incredibly helpful & happy to welcome newcomers who are looking to learn the ropes!
    • Live thread update - no need to refresh pages to see new posts/HITs they flow onto the page automatically as they're posted.
    • Desktop alerts - direct PANDAs from exported HITs right on your desktop
    • Access to the full list of HITs exported through the Daily HIT Log
    • TurkerView account which will grant you extra access to HIT review information all across mTurk through TVJS

    But most importantly you'll be joining an amazing community. You'll find all types here, from stay-at-home Moms to IT pros. We're a great group - feel free to join us!

Mturk Worker Userscripts

Discussion in 'mTurk Scripts & Resources' started by Kadauchi, Oct 22, 2017.

  1. Totally Not Salem

    Totally Not Salem Well-Known Member

    Messages:
    5,664
    Gender:
    Male
    Ratings:
    +4,986 / 45 / -0
    Works in the current stable versions of Chrome and Firefox on W10 for me.

    I have it appended to the end of your original script like so:

    PHP:
    // ==UserScript==
    // @name        MakeTitlesFit
    // @namespace   https://greasyfork.org/en/users/6503-turk05022014
    // @version     1.0.20180114
    // @description    Makes it so the title isn't truncated in the Title column.
    //              In addition to making titles fit, it will also help make requester names fit.
    //              Really long requester names won't look correct.
    //              This may break scripts.
    //              Use at your own risk.
    //              I won't be held liable; you've been warned.
    //              Has a 1500 millisecond delay to help mitigate interference with scripts.
    // @match       https://worker.mturk.com/?filters*
    // @match       https://worker.mturk.com/projects?*
    // @match       https://worker.mturk.com/projects
    // @match       https://worker.mturk.com/projects/
    // @match       https://worker.mturk.com/projects/?filters*
    // @match       https://worker.mturk.com/projects/?page_size=*
    // @match       https://worker.mturk.com/requesters/*
    // @match       https://worker.mturk.com/?*
    // @match       https://worker.mturk.com/
    // @require     http://code.jquery.com/jquery-latest.min.js
    // @grant       none
    // ==/UserScript==

    this.$ = this.jQuery jQuery.noConflict(true);
    $().
    ready(function() {
        
    window.setTimeout(function () {
            $(
    "span.requester-column.text-truncate").each(function(index) {
                $(
    this).find("a.hidden-sm-down").wrap('<div style="float:left;height:25px;"></div>');
            });
            $(
    'span.project-name-column.text-truncate, span.requester-column.text-truncate').each(function(index) {
                var 
    el = $(this).get(0);
                var 
    link = $(this).find("a");
                $(
    this).css('white-space''normal');
                if ($(
    this).parent().height() < el.clientHeight) {
                    $(
    this).parent().height(el.clientHeight);
                }
            });
        }, 
    1500);
        
    //Will wait 1500 milliseconds before activating to help prevent script conflicts.
    });

    window.addEventListener("resize"=> {
        
    let allTitles document.querySelectorAll("span.project-name-column.text-truncate, span.requester-column.text-truncate");
        for(
    let title of allTitles) {
            if(
    title.parentElement.clientHeight title.clientHeight) {
                
    title.parentElement.style.height = `${title.clientHeight}px`;
            }
        }
    });
     
  2. Turker2013

    Turker2013 New Member

    Messages:
    23
    Ratings:
    +5 / 0 / -0
    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals
    I test this on FireFox v24. The person who coded that MakeTitlesFit script is going to help me later on figure out a workaround.
    I've been trying to test the scripts on FireFox v24, FireFox v51 (greasemonkey and violentmonkey), and Chrome 49. Although, I really should be testing on more than just that, but that is what I have set up for the moment.
     
  3. Totally Not Salem

    Totally Not Salem Well-Known Member

    Messages:
    5,664
    Gender:
    Male
    Ratings:
    +4,986 / 45 / -0
    Is there some sort of reason you can't use up-to-date browsers?

    Chrome's current stable version is 63, and Firefox is on 59.

    It could be tweaked to work on older browsers, but it begs the question of why a newer browser can't just be used. Are you using a public computer that has its configuration frozen or something?
     
  4. Turker2013

    Turker2013 New Member

    Messages:
    23
    Ratings:
    +5 / 0 / -0
    There are some turkers who use lower versions of browsers. Chrome 49 is the highest for XP users. I think either FireFox 51 or 52 is the highest for XP users. I think FireFox 31 ESR is when the Chromification began, hence FireFox 24 ESR.

    Also, thank you for that snippet. It might help in an unreleased script that I use. Unreleased because I need the original author's permission before uploading it to my greasyfork account.
     
    Last edited: Jan 19, 2018
  5. Totally Not Salem

    Totally Not Salem Well-Known Member

    Messages:
    5,664
    Gender:
    Male
    Ratings:
    +4,986 / 45 / -0
    XP was released in 2001. A kid born in the year XP was released would be graduating high school right now.
    Between Vista, 7, 8, and 10, we've had 4 widely-spaced major releases since XP.
    "You can't please everyone" is a major life philosophy of mine, and "you shouldn't try to support everyone" is a convenient extension of that.

    Alright, with all of that said, this should work to dynamically resize the elements on any browser where the static resize was successful.

    But I feel dirty fixing the code, because I'd rather not encourage people to use outdated browsers.

    PHP:
    // ==UserScript==
    // @name        MakeTitlesFit
    // @namespace   https://greasyfork.org/en/users/6503-turk05022014
    // @version     1.0.20180114
    // @description    Makes it so the title isn't truncated in the Title column.
    //              In addition to making titles fit, it will also help make requester names fit.
    //              Really long requester names won't look correct.
    //              This may break scripts.
    //              Use at your own risk.
    //              I won't be held liable; you've been warned.
    //              Has a 1500 millisecond delay to help mitigate interference with scripts.
    // @match       https://worker.mturk.com/?filters*
    // @match       https://worker.mturk.com/projects?*
    // @match       https://worker.mturk.com/projects
    // @match       https://worker.mturk.com/projects/
    // @match       https://worker.mturk.com/projects/?filters*
    // @match       https://worker.mturk.com/projects/?page_size=*
    // @match       https://worker.mturk.com/requesters/*
    // @match       https://worker.mturk.com/?*
    // @match       https://worker.mturk.com/
    // @require     http://code.jquery.com/jquery-latest.min.js
    // @grant       none
    // ==/UserScript==

    this.$ = this.jQuery jQuery.noConflict(true);

    function 
    resizeOffendingRowHeights() {
        $(
    'span.project-name-column.text-truncate, span.requester-column.text-truncate').each(function(index) {
            var 
    el = $(this).get(0);
            var 
    link = $(this).find("a");
            $(
    this).css('white-space''normal');
            if ($(
    this).parent().height() < el.clientHeight) {
                $(
    this).parent().height(el.clientHeight);
            }
        });
    }

    $().
    ready(function() {
        
    window.setTimeout(function () {
            $(
    "span.requester-column.text-truncate").each(function(index) {
                $(
    this).find("a.hidden-sm-down").wrap('<div style="float:left;height:25px;"></div>');
            });
            
    resizeOffendingRowHeights();
        }, 
    0);
        
    //Will wait 1500 milliseconds before activating to help prevent script conflicts.
    });

    window.addEventListener("resize", function(e) {
        
    resizeOffendingRowHeights();
    });
     
  6. Turker2013

    Turker2013 New Member

    Messages:
    23
    Ratings:
    +5 / 0 / -0
    Resize window to make it smaller. Refresh page. Text overlaps. Maximize and unmaximize it. Text is no longer overlapping. Anyway, it is an improvement so far.

    On an unrelated note, is MTG unsafe to visit? I put it through virustotal.com and the Emsisoft engine came up with Phishing. Maybe it's a false positive.
     
    Last edited: Jan 19, 2018
  7. Totally Not Salem

    Totally Not Salem Well-Known Member

    Messages:
    5,664
    Gender:
    Male
    Ratings:
    +4,986 / 45 / -0
    Turker2013, your name checks out lol.

    MTG is long-dead.

    I've turked my way to Masters, and MTG was dead even before I even started working on the platform.
     
    • LOL LOL x 1
  8. Turker2013

    Turker2013 New Member

    Messages:
    23
    Ratings:
    +5 / 0 / -0
    Does anyone actually want mmmturkeybacon floating timers fixed? There's already some scripts that put the timer in the titlebar, although that counts down, not up.

    I do have a modified version of Color coded search with checkpoint that I'm using, but I need mmmturkeybacon's permission before uploading it. Either that, or rebuild the script so it doesn't use the same code.
    I've noticed TO1 fails quite often during the morning hours. Cache can certainly help, so that's been added. Cache expires after 30 days. Other than turkopticon.ucsd.edu and mturk-api.istrack.in, are there any mirrors I'm missing?
     
  9. TurkTiger

    TurkTiger New Member

    Messages:
    21
    Gender:
    Male
    Ratings:
    +15 / 1 / -0
  10. Kadauchi

    Kadauchi Well-Known Member

    Messages:
    3,611
    Ratings:
    +6,473 / 7 / -0
    floating timers has been mentioned a few times to me and suggested + shot down to be included into MTS.

    Just give authorship credit to MTB, you're being overly worried about it. Hell, I've only ever explicitly given permission for HIT Forker, everything else would be the same thing as you fixing/upgrading the original.

    As in won't check for that requester again for 30 days or something else?

    HIT Tracker which is part of MTS and acts similarly to how HITDB did. Nothing else and nothing close to that.
     
    • Useful / Informative Useful / Informative x 1
  11. TurkTiger

    TurkTiger New Member

    Messages:
    21
    Gender:
    Male
    Ratings:
    +15 / 1 / -0
    Ok, thanks i'll start using that then.
     
  12. Turker2013

    Turker2013 New Member

    Messages:
    23
    Ratings:
    +5 / 0 / -0
    When mmmturkeybacon Color Coded Search with Checkpoints loads reviews from turkopticon, it will cache them for 30 days. If the 5000 timeout is triggered, it will load the cached reviews instead of resulting in a plain page. This is an issue during the morning hours when TO1 tends to fail regularly. Stuff cached locally expires after 30 days because at that point, it may be too old to use anyway.

    How would floating timers work? Would it be having the current timer counting up, but hovering in view on the page at all times?
     
  13. Kadauchi

    Kadauchi Well-Known Member

    Messages:
    3,611
    Ratings:
    +6,473 / 7 / -0
    Take a look at how MTS handles cache, you don't want to be sending a request to the shitty TO servers every page load, especially during the day.

    You wouldn't really need to change how it functions, just where it gets the info from, not even having to touch where it appends.
     
  14. Turker2013

    Turker2013 New Member

    Messages:
    23
    Ratings:
    +5 / 0 / -0
    I brought that up to the person who modified the script for me. I think it now uses a cache after the five second timeout. The cache will be valid for 30 days.

    I don't want to rely on the cache 100% of the time as it can become outdated. Although, maybe I can factor in how many reviews a HIT has. Something with over 100 reviews would probably be okay, whereas something with a handful could quickly change it's rating. Especially if a requester decided to mass reject.

    I sort of want to factor TO2 into the script, but the poor way TO2 has been done complicates things.
     
  15. Kadauchi

    Kadauchi Well-Known Member

    Messages:
    3,611
    Ratings:
    +6,473 / 7 / -0
    Its a rolling updated cache. It work like this
    1. Checks the cache for all requesters on page to see the last time their review data was cached
    2. If any on page requesters cache was updated more than X min ago, update the cache for all requesters on page

    This makes it so it is never outdated and cuts down the requests significantly. Requester requester review data on every page load is borderline malicious considering the state of TO now.
     
    • Like Like x 2
  16. gman42

    gman42 New Member

    Messages:
    3
    Gender:
    Male
    Ratings:
    +0 / 0 / -0
    Looks like somewhere in the past month or so (no idea what update may have triggered it), pandas created via either of HIT Forker's panda buttons get created as "collect once", not just the O button. I know others have reported this so it's not just me. Not sure if the bug is on Forker's side, or Panda Crazy.