[Script] Displays in Title Bar the Time Remaining for HITs on Worker Website

Discussion in 'mTurk Scripts & Resources' started by Clozy, Sep 24, 2017.

  1. Clozy

    Clozy Well-Known Turker

    Messages:
    711
    Gender:
    Male
    Ratings:
    +1,640
    Hello everyone! I like to see on the title bar how much time remains before a HIT expires: I didn't find any script for the Worker Website, so I tried to make one by myself. It works fine, but there are for sure many exclusions to be added, and I've not been able to add the name of the requester after the timer (it's coded in react, and I didn't find any tutorial explaining how to use a variable from a modal). Is there anyone that knows how to get the name of the requesters from the HITs on the Worker website?
    The code looks like this

    Code:
    <div data-react-class="require('reactComponents/common/ShowModal')['default']" data-react-props="{"modalType":"ProjectDetailsModal","modalHeader":"HIT Details","modalOptions":{"requesterName":"Amazon Requester Inc. - Rekognition Team","projectTitle":"Video Activity Verification",
    
    // more code, more code ...
    
    "children":"HIT Details"}"></div>
    While the little script I made is

    Code:
    // ==UserScript==
    // @icon         https://i.imgur.com/Paa0hLq.png
    // @name         Worker Title Bar Timer
    // @author       Clozy
    // @version      1.0
    // @description  Displays in Title Bar the Time Remaining for HITs on Worker Website.
    // @include      /^https://(www\.mturkcontent|s3\.amazonaws)\.com/
    // @exclude      https://worker.mturk.com/tasks
    // @exclude      https://worker.mturk.com/projects
    // @exclude      https://worker.mturk.com/projects/?page_number=*
    // @exclude      https://worker.mturk.com/projects?filters*
    // @exclude      https://worker.mturk.com/overwatch
    // @match        *://worker.mturk.com/*
    // @require      http://code.jquery.com/jquery-latest.min.js
    // ==/UserScript==
    
    setInterval(function() {
    document.title = "﴾" + $('span.countdown-timer.p-a-xs').first().text().trim() + "﴿";
    }, 1000);
     
    • Like Like x 1
    • Today I Learned Today I Learned x 1
  2. Melting Glacier

    Melting Glacier PE: $30.01 - That's over $1.25/hour! ┬┴┤( ͡° ͜ʖ├┬┴

    Messages:
    6,157
    Gender:
    Male
    Ratings:
    +11,423
    Very cool! Works just like I thought it would. I'm a big fan of AMT Titles script. I don't complete HITs on worker.mturk often, but this will be nice for when I do. Thanks! :emoji_smile_cat:

    As for your question, that's way beyond my skills, sadly. :emoji_sweat_smile:
     
    • Like Like x 1
  3. Clozy

    Clozy Well-Known Turker

    Messages:
    711
    Gender:
    Male
    Ratings:
    +1,640
    Thank you, you're welcome, and happy birthday @Melting Glacier ! :D

    I don't complete so often HITs on worker site as well, but it's useful to have something to differentiate each HIT: and what's most useful than the remaining time?! :)
     
    • LOL LOL x 1
  4. Farout

    Farout Active Turker

    Messages:
    984
    Gender:
    Male
    Ratings:
    +809
    for some reason this script broke for me today and i'm a sad panda
     
  5. klyde

    klyde Turker

    Messages:
    72
    Gender:
    Male
    Ratings:
    +132
    Code:
    // ==UserScript==
    // @icon         https://i.imgur.com/Paa0hLq.png
    // @name         Worker Title Bar Timer
    // @author       Clozy
    // @version      1.0
    // @description  Displays in Title Bar the Time Remaining for HITs on Worker Website.
    // @include      /^https://(www\.mturkcontent|s3\.amazonaws)\.com/
    // @exclude      https://worker.mturk.com/tasks
    // @exclude      https://worker.mturk.com/projects
    // @exclude      https://worker.mturk.com/projects/?page_number=*
    // @exclude      https://worker.mturk.com/projects?filters*
    // @exclude      https://worker.mturk.com/overwatch
    // @match        *://worker.mturk.com/*
    // @require      http://code.jquery.com/jquery-latest.min.js
    // ==/UserScript==
    
    setInterval(function() {
    document.title = "﴾" + $('span.completion-timer.p-a-xs').first().text().trim() + "﴿";
    }, 1000);
    Try that. Mturk changed it's wording with the timer and I had a script fixed yesterday so this should solve it.
     
    • Today I Learned Today I Learned x 1
  6. Turker2013

    Turker2013 New Turker

    Messages:
    23
    Ratings:
    +5
    They changed it yet again. Now the timer counts up instead of down. I wish they'd stop this. It made more sense to have a countdown timer. Now I have to have my custom script redone.

    I think I have it patched. Not sure what happens on HITs exceeding 24 hours though.
     
    Last edited: Jan 25, 2018
  7. TheRevolutionHasBegun

    TheRevolutionHasBegun Active Turker

    Messages:
    106
    Gender:
    Male
    Ratings:
    +95
    Hmm, gonna try to check this out.
     
  8. TheRevolutionHasBegun

    TheRevolutionHasBegun Active Turker

    Messages:
    106
    Gender:
    Male
    Ratings:
    +95
    Oh, thank you, thank you, thank you. This is EXACTLY what I've needed.