Monday, September 17, 2007

Operator: Find people in whitepages.com.au

Here's an Operator user action to make people searchable on whitepages.com.au

You require a Surname and State/Region, and obviously, them being Australian helps.

Use cases include finding alternative (public) contact details; or confirming an address...

To install: Copy and paste this to a file, whitepages.js, use the Options menu, User Scripts, and load in whitepages.js.


var whitepages_search = {
description: "Find on Whitepages.com.au",
shortDescription: "Whitepages",
icon: "http://whitepages.com.au/wp/favicon.ico",
scope: {
semantic: {
"hCard" : "hCard",
}
},

doAction: function(semanticObject, semanticObjectType) {
var hcard, adr, url;

if (semanticObjectType == "hCard") {
hcard = semanticObject;

if (hcard.adr) {
adr = hcard.adr[0];
}

url = 'http://whitepages.com.au/wp/resSearch.do?';

url += 'subscriberName=' + encodeURIComponent(hcard.n["family-name"]);

url += '&givenName=' + encodeURIComponent(hcard.n['given-name'].substr(0, 1));

if (adr) {
if (adr['postal-code']) {
url += '&suburb=' + encodeURIComponent(adr['postal-code']);
} elseif (adr['locality']) {
url += '&locality=' + encodeURIComponent(adr['locality']);
}

if (adr['region']) {
url += '&state=' + encodeURIComponent(adr['region']);
}
}

url += '&textOnly=true';

return url;

}
}
};

SemanticActions.add("whitepages_search", whitepages_search);

No comments: