John White HIT Helper

Turns company name into a Google search link or turns the website address into a clickable link.

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        John White HIT Helper
// @author      mmmturkeybacon + ScottB
// @description Turns company name into a Google search link or turns the website address into a clickable link.
// @include     https://www.mturkcontent.com*
// @require     http://code.jquery.com/jquery-latest.min.js
// @version     1.2
// @grant       none
// @namespace https://greasyfork.org/users/6129
// ==/UserScript==

if ( $('.panel-body:contains("Find the Company Name")').length > 0 )
{ // John White Website Search
    var company_node = $("td:contains('Website:')").next();

    var company_text = company_node.text().trim().replace("&", "%26");
    var google_URL = "http://" + company_text;
    google_URL = google_URL.replace(/[" "]/g, "+");
    company_node.html('<a href="' + google_URL + '" target="_blank">' + company_text + '</a>');
}

if ( $('.panel-body:contains("Find the website address for this School")').length > 0 )
{ // John White Website Search
    var company_node = $("td:contains('School name and location:')").next();

    var company_text = company_node.text().trim().replace("&", "%26");
    var google_URL = "http://www.google.com/search?q=" + company_text;
    google_URL = google_URL.replace(/[" "]/g, "+");
    company_node.html('<a href="' + google_URL + '" target="_blank">' + company_text + '</a>');
}

else
{ // John White Company Search
    var company_node = $("td:contains('Company Name:')").next();
    var city_node = $("td:contains('City:')").next();
    var state_node = $("td:contains('State:')").next();

    var company_text = company_node.text().trim().replace("&", "%26");
    var city_text = city_node.text().trim().replace("None Listed", "");
    var state_text = state_node.text().trim().replace("None Listed", "");
    var google_URL = "http://www.google.com/search?q=" + company_text + " " + city_text + " " + state_text;
    google_URL = google_URL.replace(/[" "]/g, "+");
    company_node.html('<a href="' + google_URL + '" target="_blank">' + company_text + '</a>');
}