[Script] TurkerHub xPort

Discussion in 'mTurk Scripts & Resources' started by ChrisTurk, Dec 2, 2016.

  1. ChrisTurk

    ChrisTurk Administrator

    Messages:
    56,679
    Ratings:
    +162,927
    Introducing TurkerHub xPort

    TL;DR:
    • Install the script (click here)
    • Change the top 2 values (username/password) to match your forum account
    • Load up mTurk or HitScraper, click the buttons next to good HITs (please don't spam the forum w/ bad HITs 'testing' it
    • ??
    • Help other people profit! (..and profit by saving time/hassle)

    More In-Depth Explanation/Info

    Purpose
    Forums live and die by the HITs posted in their daily threads (over dramatic, I know). But seriously, HIT posters do a lot for us and they often go unheralded in all the hustle & bustle of trying to finish/submit HITs we all snag here. I've always thought its weird just how horrible of a process it is to actually post a HIT to a forum (or God forbid, multiple forums) so I wanted to work on streamlining the process and really encourage more HIT sharing in our community. I know folks don't love HN but fact is HITs are going to get posted somewhere, and I for one would rather see them here! :)

    So here is v1 of TurkerHub xPort. It should shave off a couple seconds every time a member is nice enough to share a HIT with the community, and as all Turkers know every second is valuable! I'd love feedback, advice, & suggestions on other improvements that could be made to the script, or the process in general. But for now, onto a quick user guide.

    Setup
    You can install the script by going clicking this: Install Link

    After installing it you'll need to change two lines around L23:

    Code:
    /* CHANGE THESE VALUES */
    var user = 'forumUsername';
    var pass = 'forumPassword';
    
    I've setup some back-end stuff to allow the script to authenticate with TH's server and post data from your account. It can't read anything private about your account, it can only authenticate & post/see publicly viewable data. Its about as secure as logging into the forum normally, its just done without the user interface. Nonetheless, please take this opportunity to review this awesome guide by @Trickydude24 about keeping your mTurk account secure!

    Once you've edited those two lines the script will be fully functional.

    Using TurkerHub xPort

    *** Please do NOT "test" the script on junk HITs. ***
    I know its hard to refrain, but with multiple users installing it in short order today it'll really clog up the forum and be a general mess. Part of the reason I'm releasing it on a Friday is because traffic should be a bit lower, so go find great HITs, make big bucks, and share the wealth with your fellow weekend warriors :)

    [​IMG]

    #1 - This is the export button. Clicking this will tell the script to send this HIT (and any comments you have noted on it) to the forum. Once you click it you're 100% done, the script will do the rest for you.
    #2 - This is the comment box. You can make note of time, bonuses, or whatever other comments you'd make about the script here.
    #3 - Previously shared HITs will be marked as unavailable to export for the rest of the day (you can repost them again tomorrow if they show back up though!). For the most part this is to cut down on spam.
    #4 - Error Notice. Before posting a HIT the script will take a quick peek at the thread and make sure no one else has already posted it in the last couple of minutes. If it finds that someone has, it'll let you know. Simply clicking this notice will dismiss it, or you can ignore it if its not in your way (it wont steal focus or render the website unresponsive).

    Things may be styled differently when this script overlays on top of something like Hit Scraper, but everything will function the same.

    That's it. Simple, efficient HIT sharing.

    Bugs, Feature Suggestions, etc

    The only currently known bug with the script is that if you're using live update on the Daily HITs thread your HIT exports will not show up for some reason. Quite frankly I have no idea where to even begin with this, but I'm inclined to leave it as is since, honestly, you don't really need to see the HIT anyway so its just clutter :dunno:. Any replies or alerts your post generates will still come through without issues (and of course you can see your post if you reload the page).

    Two people have already requester 'Hit Finder' support, so I'll add that in before the weekend's over (I tried to squeeze it in here in the last 20min, but didn't make the deadline, sorry!).

    As for everything else, please either reply to the TurkerHub xPort Discussion Thread or shoot me a DM.
     
    • Like Like x 2
    Last edited: Dec 2, 2016
  2. ceedj

    ceedj Survey Slinger

    Messages:
    2,767
    Gender:
    Male
    Ratings:
    +6,020
    @ChrisTurk two questions sir:

    i) Is there anyway to adapt this for TurkMaster? A lot of the HITs I find come from stuff I've already gotten, OR, will this show up on an already accepted HIT?
    2) This more forum related, is there anyway to get the link colors to be different than the normal text color? Or is this a design choice? Not a huge deal, just noticed a small bit of difficulty seeing a difference between the two on the default theme.
    c) Guitars, guitars, I got nothing else, guitars. ;)

    Thanks for your hard work on this!
     
  3. Laura

    Laura Survey Slinger

    Messages:
    1,113
    Gender:
    Female
    Ratings:
    +1,808
    I have a stupid question, am i supposed to leave the ' that is before and after the username and password? Does it make a difference? It thanked me for posting, so I assume that it worked, but I can't see to check. (Obviously, I don't do much with scripts.)
     
  4. Jagdpanzer

    Jagdpanzer Survey Slinger

    Messages:
    2,960
    Gender:
    Male
    Ratings:
    +3,443

    Yes, delete the letters between the (2 ') 'Jagdpanzer' and insert your info there. Do the same for your PW.
     
    • Like Like x 1
  5. leafs4_cup

    leafs4_cup Ugly Mug

    Messages:
    10,413
    Gender:
    Male
    Ratings:
    +31,260
    Has anyone been successful using this on HS in Firefox?
     
  6. ChrisTurk

    ChrisTurk Administrator

    Messages:
    56,679
    Ratings:
    +162,927
    1) I can look into it, I have a feeling TM is a little weirder to overlay this onto than HS/HF but it might be possible. Almost 100% I can add it to an already accepted HIT (I actually thought I'd done this.. since it was on my original outline plan.. whoops?)

    2) Blargh, I changed this on the dark theme, will get it done on main theme as well today.

    3) I'm getting a guitar for Christmas? Yaaaay.

    I only tested this in Chrome, I'll give it a whirl in FF in a bit (..just crawled out of bed :()
     
    • Like Like x 2
  7. ceedj

    ceedj Survey Slinger

    Messages:
    2,767
    Gender:
    Male
    Ratings:
    +6,020
    TM would be nice, but I get the weirdness. I have a search set to $2 or better so I see stuff fly by sometimes that I already did. But having it on accepted HITs would be FABOO! :)
     
    • Like Like x 1
  8. Kadauchi

    Kadauchi Administrator Former MTG MotM

    Messages:
    4,367
    Ratings:
    +8,589
    Cool, this is like when I had kadabot post HITs for me when I clicked a button on HF (had to route through that since MTC isn't https). Obviously this is better since you have it running straight through the forum, good job.
     
    • Love Love x 1
  9. Kadauchi

    Kadauchi Administrator Former MTG MotM

    Messages:
    4,367
    Ratings:
    +8,589
    @ChrisTurk I'm starting my work back up on turkplus this month to get it published by the end of the year. Do you mind if I include the export straight to turkerhub in it?
     
    • Like Like x 1
  10. ChrisTurk

    ChrisTurk Administrator

    Messages:
    56,679
    Ratings:
    +162,927
    Yeah, I had something similar w/ TurkBot when MTG was up and running, but now that I have back end access the possibilities are limitless. Its fun :) The difficulty is figuring out a proper way to integrate it with HS, HF, etc that I don't have any real access/control over.

    I don't know how you're scraping hits for HN, but the functionality is there that this may be easier to pull from :dunno:

    Not at all. Please save me the trouble of crap-hacking over your work, lol. I hate having to overlay on top of other userscripts, it just feels weird/wrong, but it was the best option I could come up with. I'm probably going to change the way I'm doing it now and just store the hash locally to make less calls in the future, but its completely negligible either way.

    Is the issue when you go to export a HIT or are the buttons not showing up at all? On HS/FF for me the buttons load but exporting is broken. Just want to make sure I've got the right problem to solve lol.
     
  11. leafs4_cup

    leafs4_cup Ugly Mug

    Messages:
    10,413
    Gender:
    Male
    Ratings:
    +31,260
    It shows up properly, and seems to work right up until I click on the export button. Then my screen turns dark, the page basically freezes, and the export doesn't happen.

    Afterwards, when I refresh, it acknowledges that the Hit has already been exported.
     
  12. ChrisTurk

    ChrisTurk Administrator

    Messages:
    56,679
    Ratings:
    +162,927
    Haha, yeah same thing. Alrighty I'll include the fix in next update (prob Sun/Mon), for now NO EXPORTS FOR YOU! (Sorry! :() Working on top of other people's scripts is super unstable, and I picked probably the worst way to rip the data from HS lol.. I may completely rewrite that and do it more seamlessly but I was lazy and didn't want to rewrite a whole new export so I basically have xPort "stealing" HS's export then closing it really quickly so people don't notice (lol, such an awful idea). In FF it seems to not close it properly.. You caught me :(
     
    • Like Like x 1
  13. leafs4_cup

    leafs4_cup Ugly Mug

    Messages:
    10,413
    Gender:
    Male
    Ratings:
    +31,260
    Haha, it's all good, just figured you'd want to know.
     
  14. Kadauchi

    Kadauchi Administrator Former MTG MotM

    Messages:
    4,367
    Ratings:
    +8,589
    HF is up next after turkplus, so when I redo the buttons to have toggle options similar to HS to be able to turn them off/on I can add this in at that time too.

    Also, instead of running a 250ms setInterval, you should attached it to a 'DOMSubtreeModified' event so it'll just fire when new results are rendered.
     
    • Today I Learned Today I Learned x 1
  15. Kadauchi

    Kadauchi Administrator Former MTG MotM

    Messages:
    4,367
    Ratings:
    +8,589
    @ChrisTurk
    Like this
    Code:
    // ==UserScript==
    // @name         preset
    // @namespace    https://gist.github.com/Kadauchi
    // @version      1.0.0
    // @description  blank
    // @author       Kadauchi
    // @icon         http://i.imgur.com/oGRQwPN.png
    // @include      https://worker.mturk.com/?finder_beta
    // @include      https://www.mturk.com/mturk/findhits?match=true?finder_beta
    // @grant        GM_log
    // @require      https://code.jquery.com/jquery-3.1.1.min.js
    // ==/UserScript==
    
    
    if (document.URL.match(/finder_beta/)) {
      $('#new_hits').on('DOMSubtreeModified', () => { $('#new_hits').off('DOMSubtreeModified'); new_hits(); });
      $('#log_hits').on('DOMSubtreeModified', () => { $('#log_hits').off('DOMSubtreeModified'); log_hits(); });
    }
    
    const new_hits = () => {
      for (let hit of $('#new_hits').find('.cont:not(.th)')) {
        $(hit).find('button:contains(IRC)').after('<button>TH</button>');
      }
      $('#new_hits').on('DOMSubtreeModified', () => { $('#new_hits').off('DOMSubtreeModified'); new_hits(); });
    };
    
    const log_hits = () => {
      for (let hit of $('#log_hits').find('.cont:not(.th)')) {
        $(hit).addClass('th').find('button:contains(IRC)').after('<button>TH</button>');
      }
      $('#log_hits').on('DOMSubtreeModified', () => { $('#log_hits').off('DOMSubtreeModified'); log_hits(); });
    };
     
    • Today I Learned Today I Learned x 1
  16. Juniper

    Juniper Active Turker

    Messages:
    428
    Ratings:
    +1,603
    For me the buttons aren't showing up at all. Using FF too.
     
  17. ChrisTurk

    ChrisTurk Administrator

    Messages:
    56,679
    Ratings:
    +162,927
    On HS or regular mTurk?
     
  18. Juniper

    Juniper Active Turker

    Messages:
    428
    Ratings:
    +1,603
    HS. It's showing up fine on mTurk, just haven't tested it yet.
     
    • Today I Learned Today I Learned x 1
  19. WimpLo

    WimpLo Survey Slingin' Batch Masta Former MTG MotM

    Messages:
    34,780
    Gender:
    Female
    Ratings:
    +73,155
    HS's scroll bar goes missing every time I use it. Is anyone else having this issue? I tested it with no other scripts and it still does it. :dunno:
     
  20. ChrisTurk

    ChrisTurk Administrator

    Messages:
    56,679
    Ratings:
    +162,927
    Yeah someone else reported the same thing. It'll be fixed on the Sunday night / Monday morning upgrade push :)
     
    • Like Like x 1