Greasy Fork

DCI New HIT Monitor - Party Edition

Scans first 3 pages of new HITs for your search terms.

当前为 2014-11-07 提交的版本,查看 最新版本

// ==UserScript==
// @name        DCI New HIT Monitor - Party Edition
// @namespace   DCI
// @description Scans first 3 pages of new HITs for your search terms.
// @version     1.0
// @include     https://www.mturk.com/mturk/viewsearchbar?searchWords=&selectedSearchType=hitgroups&sortType=LastUpdatedTime%3A1&pageNumber=2&searchSpec=HITGroupSearch%23T%231%2310%23-1%23T%23%21Reward%216%21rO0ABXQABDAuMDA-%21%23%21LastUpdatedTime%211%21%23%21
// @include     https://www.mturk.com/mturk/viewsearchbar?searchWords=&selectedSearchType=hitgroups&sortType=LastUpdatedTime%3A1&pageNumber=3&searchSpec=HITGroupSearch%23T%232%2310%23-1%23T%23!Reward!6!rO0ABXQABDAuMDA-!%23!LastUpdatedTime!1!%23!
// @include     https://www.mturk.com/mturk/viewsearchbar?searchWords=&selectedSearchType=hitgroups&sortType=LastUpdatedTime%3A1&pageNumber=1&searchSpec=HITGroupSearch%23T%233%2310%23-1%23T%23!Reward!6!rO0ABXQABDAuMDA-!%23!LastUpdatedTime!1!%23!
// @require     http://code.jquery.com/jquery-latest.min.js
// ==/UserScript==

// Bookmark the following link and use it to activate the script
// https://www.mturk.com/mturk/viewsearchbar?searchWords=&selectedSearchType=hitgroups&sortType=LastUpdatedTime%3A1&pageNumber=1&searchSpec=HITGroupSearch%23T%233%2310%23-1%23T%23!Reward!6!rO0ABXQABDAuMDA-!%23!LastUpdatedTime!1!%23!


SleepTime  = 300  //seconds HIT Monitor sleeps after an alert

ScanTime = 2   // Seconds between scans


function searchterms(){ var needles = new Array(
  
// Add search terms here.
// You can use any text found on the search page or inside of links  
// This includes requester names, HIT names, text from descriptions, keywords, requester IDs and HIT IDs
// All search terms must be in quotes and separated by a comma

    
"ACME Data Collection",
"agent agent",
"AJ Ghergich",
"Andy K",
"BICC",
"Bluejay Labs",
"carnegie mellon social computing group",
"Christos Koritos",    
"Dan Shaffer",
"David Mease",
"Funicular Heavy Industries",   
"Heather Walters",
"JASON W GULLIFER",
"Jeff Foster",
"jesse egbert",
"Jonathan Frates",
"Leonid Sigal",
"nabirds",  
"OCMP",
"Parisa",
"pickfu",
"Procore", 
"Project Endor",
"Project Gandolph",
"Sergey Schmidt",
"SIRIUSProject",
"Smartsheet",
"Spreecast",
"Two Lakes",
"User Manual",
"vaplab",    
"Wharton",    
"x8 data"
    
//==[Be careful not to put a comma after the last item on your list]==\\    
    
);

var haystack = document.body.innerHTML;

var my_pattern, my_matches, found = "";
for (var i=0; i<needles.length; i++){
my_pattern = eval("/" + needles[i] + "/gi");
my_matches = haystack.match(my_pattern);
if (my_matches){
found += "\n" + my_matches.length + " found for " + needles[i];}}

BellSound = new Audio("http://static1.grsites.com/archive/sounds/musical/musical002.wav"); 
if (found != ""){BellSound.play();

setTimeout(function(){alert("Alert" + found)}, 2000);

setTimeout("location.reload(true);",SleepTime*1000);}
                      
else
secondpage();}

function secondpage(){
var textsearch = $( ":contains('1-10')" );
if (textsearch.length){
setTimeout(function()(window.location.replace("https://www.mturk.com/mturk/viewsearchbar?searchWords=&selectedSearchType=hitgroups&sortType=LastUpdatedTime%3A1&pageNumber=2&searchSpec=HITGroupSearch%23T%231%2310%23-1%23T%23%21Reward%216%21rO0ABXQABDAuMDA-%21%23%21LastUpdatedTime%211%21%23%21")),ScanTime*1000); }  
else
thirdpage();}

function thirdpage(){
var textsearch = $( ":contains('11-20')" );
if (textsearch.length){
setTimeout(function()(window.location.replace("https://www.mturk.com/mturk/viewsearchbar?searchWords=&selectedSearchType=hitgroups&sortType=LastUpdatedTime%3A1&pageNumber=3&searchSpec=HITGroupSearch%23T%232%2310%23-1%23T%23!Reward!6!rO0ABXQABDAuMDA-!%23!LastUpdatedTime!1!%23!")),ScanTime*1000); }  
else
firstpage();}

function firstpage(){
var textsearch = $( ":contains('21-30')" );
if (textsearch.length){
setTimeout(function()(window.location.replace("https://www.mturk.com/mturk/viewsearchbar?searchWords=&selectedSearchType=hitgroups&sortType=LastUpdatedTime%3A1&pageNumber=1&searchSpec=HITGroupSearch%23T%233%2310%23-1%23T%23!Reward!6!rO0ABXQABDAuMDA-!%23!LastUpdatedTime!1!%23!")),ScanTime*1000); }  
}

searchterms();

document.title = "HIT Monitor";