// ==UserScript==
// @name          O'Reilly ISBN Link2Amazon.co.uk
// @namespace     http://www.unixdaemon.net/gmscripts/
// @description   Replace the text ISBN with a link to amazon.co.uk
// @include       http://oreilly.com/catalog/*
// @include       http://www.oreilly.com/catalog/*
// @include       http://oreilly.co.uk/catalog/*
// @include       http://www.oreilly.co.uk/catalog/*
// ==/UserScript==


// the regex bit is hacky as heck but it works for me.
if(document.body.innerHTML.match("ISBN:")) {
  document.body.innerHTML = document.body.innerHTML.replace(
    /ISBN: ([\w|\d]*)-([\w|\d]*)-([\w|\d]*)-([\w|\d]*)/, "ISBN: <a href='http://www.amazon.co.uk/o/ASIN/$1$2$3$4'>$1$2$3$4</a>");
}

