您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
This is a grouped script. If you want just the link, or just the dashboard, find my other scripts on GreasyFork. Shows the number of hits you have accepted, lists theme, and also a link to HIT scraper.
当前为
// ==UserScript== // @name HITs Accepted on Dashboard/HIT Scraper Link // @namespace http://ericfraze.com // @version 0.1 // @description This is a grouped script. If you want just the link, or just the dashboard, find my other scripts on GreasyFork. Shows the number of hits you have accepted, lists theme, and also a link to HIT scraper. // @author Eric Fraze // @match https://www.mturk.com/mturk/* // @grant none // @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js // ==/UserScript== var hitsAssigned = "N/A (there was an error or something, contact Magnilucent if it happens a lot)"; var hitString = ""; var title = []; var requester = []; var pay = []; var timeLeft = []; var returnURL = []; var continueURL = []; url = window.location.href; if ( url.indexOf("dashboard") !== -1 ) { $.ajax({ url: "https://www.mturk.com/mturk/myhits", dataType: "html", success: function(data) { if ( $("td:contains('There are currently no HITs assigned to you.')", data).length ) { hitsAssigned = 0; }else{ var text = $("td.title_orange_text[style='white-space: nowrap; padding-top: 1ex;']", data).text(); var regstring = /(\d{1,2})(\sResults)/; var reg = new RegExp(regstring); var groups = reg.exec(text); hitsAssigned = groups[1]; hitString = '<table class="metrics-table" width="100%">' + '<tbody><tr class="metrics-table-header-row">' + '<th class="metrics-table-first-header">' + 'Title' + '</th>' + '<th>' + 'Requester' + '</th>' + '<th>' + 'Reward' + '</th>' + '<th style="white-space: nowrap;">' + 'Time Left' + '</th>' + '<th>' + 'Return' + '</th>' + '</tr>'; $('table[width="100%"][height="100%"]', data).each( function(i) { title[i] = $(this).find("a.capsulelink[href='#']").text().trim(); requester[i] = $(this).find(".requesterIdentity").text() pay[i] = $(this).find(".reward").text() timeLeft[i] = $(this).find("td[width='25%'] td.capsule_field_text").text().trim(); var sign = "odd" if ( ((i + 1)/2) == Math.round((i + 1)/2) ) sign = 'even'; timeLeft[i] = timeLeft[i].replace(" minutes", "m").replace(" seconds", "s");; returnURL[i] = $(this).find("a[href^='/mturk/return']").attr("href"); continueURL[i] = $(this).find("a[href^='/mturk/continue']").attr("href"); hitString += '<tr class="' + sign + '">' + '<td class="metrics-table-first-value"><a href="' + continueURL[i] + '">' + (title[i].length > 60 ? title[i].substring(0, 60 - 3) + '...' : title[i]) + '</a></td>' + '<td style="white-space: nowrap;"><a href="/mturk/searchbar?searchWords=' + encodeURIComponent(requester[i]) + '">' + (requester[i].length > 15 ? requester[i].substring(0, 15 - 3) + '...' : requester[i]) + '</a></td>' + '<td>' + pay[i] + '</td>' + '<td>' + timeLeft[i] + '</td>' + '<td style="text-align: center;"><a href="' + returnURL[i] + '">Return</a></td>' + '</tr>'; }); hitString += '</tbody></table>'; } addHitNumber(); } }); } $(document).ready(function() { if ( $("td:contains('Your HIT Status')").length ) { $("#subtabs a:contains('Introduction')").attr("href", "https://www.mturk.com/mturk/findhits?match=true?hit_scraper"); $("#subtabs a:contains('Introduction')").text("HIT Scraper"); addHitNumber(); }else{ $("#subtabs").prepend("<a class='subnavclass' href='https://www.mturk.com/mturk/findhits?match=true?hit_scraper'>HIT Scraper</a><span class='almostblack_text'> | </span>"); } }); function addHitNumber() { if ( !$("#HITNumber").length ){ $("td:contains('Your HIT Status')").parents("table").before('<table width="760" align="center" cellspacing="0" cellpadding="0"><tbody><tr height="25px"><td width="10" bgcolor="#7fb4cf" style="padding-left: 10px;"></td><td width="100%" bgcolor="#7fb4cf" class="white_text_14_bold"><a href="https://www.mturk.com/mturk/myhits">HITs Assigned to You</a> (<span id="HITNumber">' + hitsAssigned + '</span>)</td><td width="10" align="right" bgcolor="#7fb4cf"></td></tr><tr><td class="container-content" colspan="3"><table class="metrics-table" width="100%"><tbody><tr><td id="HITInfo"></td></tr></tbody></table></td></tr></tbody></table>'); $("#HITInfo").append(hitString); }else{ $("#HITNumber").text(hitsAssigned); $("#HITInfo").empty(); $("#HITInfo").append(hitString); } }