// ==UserScript==
// @name ALAProp->GG links
// @description Create links to gainesville-green.com from alaprop
// @namespace http://gainesville-green.com
// @version 0.3.1
// @include http://www.acpafl.org/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js
// ==/UserScript==
//Can be turned into a bookmarklet with http://benalman.com/code/test/jquery-run-code-bookmarklet/
function buildUrl(srcurl) {
var m = srcurl.match(/Parcel=([0-9-]+)/);
if (m) {
return "http://gainesville-green.com/search-homes?parcel=" + m[1];
}
return null;
}
function createSiblingLink(table,url) {
if(url){
$('a:contains(GIS)',table).after("
View on Gainesville-Green.com");
}
}
function ownerresults() {
$("b:contains('Parcel') + a")
.each(function(idx,linktag) {
createSiblingLink(linktag.parentNode.parentNode, buildUrl(linktag.href));
});
}
function ParcelResults() {
createSiblingLink(null,buildUrl(window.location.search));
}
if(window.location.pathname.match(/^\/ParcelResults.asp/)) {
ParcelResults();
}
else if(window.location.pathname.match(/^\/(zip|legal|owner|nbhd|sbdv|comb)results.asp/)){
ownerresults();
}