NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name Whitepages Search: Salesforce Contact // @namespace http://pro.whitepages.com // @version 0.1 // @description validate contact info for Salesforce Contacts // @author Trevor Anderson // @grant none // ==/UserScript== var addressDiv = document.getElementById('con19_ileinner'); var addressChildren = addressDiv.childNodes; var haveAddress = false; var street = ''; var citystatezip = ''; for(var i = 0; i < addressChildren.length; i++){ if(addressChildren[i].nodeName == "TABLE"){ haveAddress = true; firstTD = addressChildren[i].childNodes[0].childNodes[0].childNodes[0]; street = firstTD.childNodes[0].nodeValue; citystatezip = firstTD.childNodes[2].nodeValue; break; } } var nameDiv = document.getElementById('con2_ileinner'); var nameStr = nameDiv.textContent; var phoneDiv = document.getElementById('con12_ileinner'); var phoneStr = phoneDiv.textContent; var emailDiv = document.getElementById('con15_ileinner'); var emailStr = emailDiv.textContent; if(haveAddress){ var a = document.createElement("a"); var linkText = document.createTextNode("Search this address on Whitepages"); a.href = "http://pro.lookup.whitepages.com/addresses?street="+encodeURIComponent(street)+"&where="+encodeURIComponent(citystatezip); a.target = "_blank"; a.appendChild(linkText); a.style.font = "bold 14px calibri"; a.style.color = "#F37320"; addressDiv.appendChild(a); a = document.createElement("a"); var linkText = document.createTextNode("Validate this contact on Whitepages"); var href = "https://pro.lookup.whitepages.com/identity_checks?"; href += "address_street_line_1="+encodeURIComponent(street); href += "&address_postal_code="+citystatezip.substr(citystatezip.length - 5); if(nameStr.length > 0) href += "&name="+encodeURIComponent(nameStr); if(phoneStr.length > 0) href += "&phone="+encodeURIComponent(phoneStr); if(emailStr.length > 0) href += "&email_address="+encodeURIComponent(emailStr); a.href = href; a.target = "_blank"; a.appendChild(linkText); a.style.font = "bold 14px calibri"; a.style.color = "#F37320"; nameDiv.appendChild(document.createElement("br")); nameDiv.appendChild(a); }