[Script] Script to Track Time in Daily Activity?

Discussion in 'mTurk Scripts & Resources' started by Richard R, Sep 4, 2020.

  1. Richard R

    Richard R Turker

    Messages:
    69
    Gender:
    Male
    Ratings:
    +33
    I have been looking lately, with little success, for a script that can track the actual time that I am working on a HIT (from the time I open it from my queue to the time I submit the HIT) and saves that time into my daily activity page. I would try to work on this script myself but I promised my gf (Alexandra in VT) that I would try to spend more time working and less time coding. If anyone knows of a script like this I would greatly appreciate it, as it's my mission to give feedback to all requesters who I realize are paying under $6 per hour. Having a script like this would allow me to have more information to give to them to back up my points, but also better allow me to track batches to determine if they are worth it in the long run.


    p.s.: On further thought, the script wouldn't necessarily have to save the times in daily activity, but really anywhere that I could access the list and calculate batch average times and such.
     
  2. Kadauchi

    Kadauchi Administrator Former MTG MotM

    Messages:
    4,367
    Ratings:
    +8,589
    I'm pretty sure MTSv3 will have what you're looking for, specifically HIT Tracker. It will save the time spent for each HIT you submit. In the HIT Tracker interface you'll be able to search for HITs within a date range. You can view the HIT found within that range individually (tasks), grouped together by requester (requesters), grouped together by batch (projects) or group together by day (daily).

    [​IMG]

    This will be ready soon.
     
    • Love Love x 2
  3. Richard R

    Richard R Turker

    Messages:
    69
    Gender:
    Male
    Ratings:
    +33
    Thank you. I've downloaded the github repository and installed it as an extension on chrome. Can't seem to get to any pages, though. I was looking at the source code and it seems a little beyond my experience level. I was hoping I could figure out something to jam in there to use for myself, even if it wasn't perfect yet.
     
  4. Richard R

    Richard R Turker

    Messages:
    69
    Gender:
    Male
    Ratings:
    +33
    Actually, since you seem pretty experienced, could you point me in a direction where I could find information about writing scripts that work with the iframes that are ever-present in HITs now. I've been trying to figure out a way to get some simple keybindings to work, but no luck yet.
     
  5. Kadauchi

    Kadauchi Administrator Former MTG MotM

    Messages:
    4,367
    Ratings:
    +8,589
    That's all old code and stuff for the MTSv2, none of it would be particularly useful here.

    All you should have to do is add the iframe's domain to the script's @include so that the script runs on the HIT and then make sure that the iframe has focus so that you keypresses are being dispatched to the correct window.

    https://greasyfork.org/en/scripts/24650-mturk-radio-keybinds/code
     
  6. Richard R

    Richard R Turker

    Messages:
    69
    Gender:
    Male
    Ratings:
    +33
    Wow! Thank you so much. I never thought of that. haha. I was looking up crazy stuff like using PostMessage to get around CORS. The best answer always seems so simple. Seriously, many thanks. And yeah, I went to your gitHub page to look at the code for Mturk Suite Version 3 to see if I could implement something that would give me any sort of record of HIT completion times. Looks like a lot of .tsx files (Angular?) and I'm just starting to get a handle on plain JavaScript with a tiny bit of React so far.
     
  7. Kadauchi

    Kadauchi Administrator Former MTG MotM

    Messages:
    4,367
    Ratings:
    +8,589
    React but in TypeScript (JavaScript but with types), so you'll possibly come across this more once you get deeper into React.
     
  8. jim718181

    jim718181 Survey Slinger

    Messages:
    2,572
    Gender:
    Male
    Ratings:
    +3,515
    Adding the line
    window.focus();
    may save you a lot of aggravation in the future.
     
    • Like Like x 1
  9. Fuzzy_Dunlop

    Fuzzy_Dunlop Turker

    Messages:
    156
    Gender:
    Male
    Ratings:
    +58
    If you're interested in accounting for time outside of the HITs as well (returned, searching, forums), check out ActivityWatch (activitywatch.net). There is a browser addon for Chromium & Firefox that will keep track of the Tabs as well.

    You'll need to fine tune the patterns for matching window titles. If you feel like getting creative, you can create specific filters for batches, time spent previewing a hit vs. working on it and so on.


    (1) sample setup
    ActivityWatch_Categories.png
    (2) sample output
    ActivityWatch_Output.png
     
  10. Richard R

    Richard R Turker

    Messages:
    69
    Gender:
    Male
    Ratings:
    +33
    Thank you, Fuzzy_Dunlop. That seems very interesting as I have been checking it out. I was actually looking for something like that, also, a while ago. I wanted to keep track of how I spent my time between learning coding and time I spent on Mturk.