Skip to content

Instantly share code, notes, and snippets.

@jdubwelch
Last active March 3, 2020 17:27
Show Gist options
  • Select an option

  • Save jdubwelch/5f0484c90a7ea4a5e843baa77c5ad9f9 to your computer and use it in GitHub Desktop.

Select an option

Save jdubwelch/5f0484c90a7ea4a5e843baa77c5ad9f9 to your computer and use it in GitHub Desktop.
javascript:
(function(){
var idxID, listingID;
idxID=prompt("MLS (or both):");
var regex = /(?<idxID>[a-z]{1}[0-9]{3})(\/|::listing::)(?<listingID>.*)/gm;
if (match = regex.exec(idxID)) {
idxID = match.groups.idxID;
listingID = match.groups.listingID;
}
if (!listingID) {
listingID=prompt('Listing ID:');
}
url='http://couchbase-internal.idxsandbox.com:8091/pools/default/buckets/mls-data/docs/'+idxID+'::listing::'+listingID;
window.location=url;
})();
javascript: (function(){var idxID, listingID; idxID=prompt("MLS (or both):"); var regex = /(?<idxID>[a-z]{1}[0-9]{3})(\/|::listing::)(?<listingID>.*)/gm; if (match = regex.exec(idxID)) {idxID = match.groups.idxID; listingID = match.groups.listingID; } if (!listingID) {listingID=prompt('Listing ID:'); } url='http://couchbase-internal.idxsandbox.com:8091/pools/default/buckets/mls-data/docs/'+idxID+'::listing::'+listingID; window.location=url; })();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment