1. API Information

    The TurkerView API page has instructions as well as contact information for support in getting set up with our new API infrastructure.

    You can also email us directly at hello@turkerview.com if you run into any problems!

    Dismiss Notice

[Script] Panda Crazy Add-On for Overwatch

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

  1. ceedj

    ceedj Survey Slinger

    Messages:
    2,117
    Gender:
    Male
    Ratings:
    +4,195
    [​IMG]

    This small add-on to Overwatch adds PandaCrazy buttons on each new HIT. Code is only five lines, but it's critical to ensure the code goes into Overwatch at the right spot.

    Some notes: Both PandaCrazy and Overwatch must be on Worker (this won't matter in a few days, as everything will be on worker), and make sure you have the Worker version of Overwatch installed. If you use the following addresses to access PC and OW:

    Overwatch: https://worker.mturk.com/overwatch
    PandaCrazy: https://worker.mturk.com/?filters[search_term]=pandacrazy=on
    EDIT: More recent PC link: https://worker.mturk.com/requesters/PandaCrazy/projects


    Then you should be fine. Please note that if Overwatch updates, you will need to add this again to Overwatch, as this script is an add-on, and not part of the original code. Also, this add-on is placed inside the Overwatch script, and communicates with PandaCrazy (I send the GID found in OW to PC), not the other way around.

    Look for this line (line 405-ish in the most current version of Overwatch):

    Code:
      $("#rightWindow").prepend(display_HTML);
    }
    
    The add-on code:
    Code:
    //Panda Crazy add-on starts here:
       function PC_Panda(){localStorage.setItem("JR_message_pandacrazy", JSON.stringify({"time":(new Date().getTime()),"command":"addJob","data":{"groupId":hitObject.GID} }));}
       function PC_Once(){localStorage.setItem("JR_message_pandacrazy", JSON.stringify({"time":(new Date().getTime()),"command":"addOnceJob","data":{"groupId":hitObject.GID} }));}
       $(`div[value='${hitObject.GID}']`).append($("<button class ='text_css offSet'>").html("Once").click(PC_Once));
       $(`div[value='${hitObject.GID}']`).append($("<button class ='text_css offSet'>").html("Panda").click(PC_Panda));
       $(`div[value='${hitObject.GID}']`).append($("<span class ='text_css offSet'>").html("[PC] Add: "));
    
    The add-on code NEEDS to go in the spot between the semi-colon ( ; ) and the right brace ( } ), so it looks like this:
    Code:
    $("#rightWindow").prepend(display_HTML);
    //Panda Crazy add-on starts here:
       function PC_Panda(){localStorage.setItem("JR_message_pandacrazy", JSON.stringify({"time":(new Date().getTime()),"command":"addJob","data":{"groupId":hitObject.GID} }));}
       function PC_Once(){localStorage.setItem("JR_message_pandacrazy", JSON.stringify({"time":(new Date().getTime()),"command":"addOnceJob","data":{"groupId":hitObject.GID} }));}
       $(`div[value='${hitObject.GID}']`).append($("<button class ='text_css offSet'>").html("Once").click(PC_Once));
       $(`div[value='${hitObject.GID}']`).append($("<button class ='text_css offSet'>").html("Panda").click(PC_Panda));
       $(`div[value='${hitObject.GID}']`).append($("<span class ='text_css offSet'>").html("[PC] Add: "));
    }
    
    If the code winds up outside the brace, the buttons may show, but not work, so make sure your code looks like the above.

    Thanks JR (PandaCrazy author), Ethraiel (author of Overwatch) and all the great testers who tried this out and found it useful. If you too find it useful and you want to donate, please use the Donate link above!
     
    • Love Love x 10
    • Useful / Informative Useful / Informative x 6
    • Like Like x 4
    Last edited: Feb 7, 2018
  2. ref2018

    ref2018 New Turker

    Messages:
    8
    Gender:
    Female
    Ratings:
    +10
    Yay, thanks! I got it working!

    This might be my first post on here, I'm not sure. I joined all the forums and I have not kept track of which ones I posted on. I go by this username on reddit too.

    Have a pleasant day!
     
    • Love Love x 1
  3. Dr McCoy

    Dr McCoy Active Turker

    Messages:
    403
    Gender:
    Male
    Ratings:
    +825
    I love you, man. Thank you.
     
    • Like Like x 1
  4. HarryHood

    HarryHood Survey Slinger

    Messages:
    2,584
    Gender:
    Male
    Ratings:
    +4,205
    Dude, thank you so much for this add on! This really speeds up my workflow.
     
    • Like Like x 1
  5. knottypiper

    knottypiper Survey Slinger

    Messages:
    5,771
    Gender:
    Female
    Ratings:
    +12,722
    [​IMG]

    This is amazing! Thank you!!
     
    • Like Like x 1
    • LOL LOL x 1
  6. klyde

    klyde Turker

    Messages:
    58
    Gender:
    Male
    Ratings:
    +118
    Edited: nvm
     
  7. BurtTurker

    BurtTurker New Turker

    Messages:
    17
    Gender:
    Male
    Ratings:
    +15
    brilliant, thank you.
     
  8. klyde

    klyde Turker

    Messages:
    58
    Gender:
    Male
    Ratings:
    +118
    Edited: nvm
     
    Last edited: Feb 22, 2018
  9. ceedj

    ceedj Survey Slinger

    Messages:
    2,117
    Gender:
    Male
    Ratings:
    +4,195
    From what I can tell, there has been no upgrade for OW in 58 days. In any case, where it goes hasn't changed, per the first post.
     
  10. klyde

    klyde Turker

    Messages:
    58
    Gender:
    Male
    Ratings:
    +118
    Yeah, no idea what I was looking at. Just checked again and right there it was.
     
  11. ScooterPie

    ScooterPie Active Turker

    Messages:
    168
    Gender:
    Female
    Ratings:
    +349
    Awesome! THANK YOU! :)
     
  12. SunlitSunflower

    SunlitSunflower Well-Known Turker

    Messages:
    4,329
    Ratings:
    +4,073
    For some reason this doesn't work? It creates the task in Panda crazy but it doesn't want to search for it. It searches once and then stops and turns purple. Have I done something wrong?
     
  13. lefty

    lefty Survey Slinger

    Messages:
    18,802
    Gender:
    Female
    Ratings:
    +48,730
    When a link goes purple in Panda crazy it's because you're not qualified
     
    • Useful / Informative Useful / Informative x 1
  14. SunlitSunflower

    SunlitSunflower Well-Known Turker

    Messages:
    4,329
    Ratings:
    +4,073
    Oh god, I look dumb. Thank you!
     
    • Like Like x 1
  15. Havoc928

    Havoc928 Active Turker

    Messages:
    674
    Gender:
    Male
    Ratings:
    +727
    It works! thank you, I use this to look for surveys when it is slow
     
  16. moonshay76

    moonshay76 Well-Known Turker

    Messages:
    1,129
    Gender:
    Female
    Ratings:
    +1,176
    this is great I love it
     
  17. Trinidad

    Trinidad Turker

    Messages:
    117
    Ratings:
    +87
    Just wanted to say thanks for sharing this, super helpful for efficiency.