Stephanie Hass ZIP Lookup

Turns company name into a Google Maps search link.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name        Stephanie Hass ZIP Lookup
// @author      mmmturkeybacon + ScottB
// @description Turns company name into a Google Maps search link.
// @include     https://www.mturkcontent.com*
// @require     http://code.jquery.com/jquery-latest.min.js
// @version     1.0
// @grant       none
// @namespace https://greasyfork.org/users/6129
// ==/UserScript==

{ // Stephanie Haas ZIP Lookup 
    var company_node = $("p:contains('Restaurant Name:')").children('strong');
    var address_node = $("p:contains('Address:')").children('b');
    var city_text = $("p:contains('City:')").children('b').text().trim();
    var state_text = $("p:contains('State:')").children('b').text().trim();
    var country_text = $("p:contains('Country:')").children('b').text().trim();

    var company_text = company_node.text().trim().replace("&", "%26");
    var address_text = address_node.text().trim().replace("#", "%23");
    var google_URL = "http://maps.google.com/?q=" + company_text + " " + address_text + " " + city_text + " " + state_text + " " + country_text;
    google_URL = google_URL.replace("Business Name: ","").replace(/[" "]/g, "+");
    company_node.html('<a href="' + google_URL + '" target="_blank">' + company_text + '</a>');
}