Kia ora Tim,

The first webform example that comes to mind as similar to what you want is at

As written the function convert(form) has some extra stuff around DOIs and EBL ( which you can strip out.
For normalising the PURL, I think I'd do it in three steps:
1) remove the "" string if present
2) remove "" if present
3) prepend ""

Feel free to email me if you need more information - I'm not sure how familiar you are with javascript.


-----Original Message-----
From: Code for Libraries [mailto:[log in to unmask]] On Behalf Of Tim Pellett
Sent: Tuesday, 11 June 2013 1:28 a.m.
To: [log in to unmask]
Subject: [CODE4LIB] PURL normalizer script


Has anyone created a script to help normalize PURLS that go through the EZProxy rewrite, that they would be willing to share?

The script would have to be smart enough to do the following:

1. Prepend the proxy prefix url if it does not exist.
2. Remove the proxy rewrite from either the proxy prefix and/or the vendor's url.

For example, a sample url would be:

In this example, the proxy prefix is already there, but the rewrite, "." exists in two places and would need to be removed.

I visualize a web form that the patron would copy/paste the url into the text box and click button and new, working url will be there for user to use for future use.
Tim Pellett
Library Support Specialist
Maine InfoNet, University of Maine
Phone: 207.581.3086

P Please consider the environment before you print this email.
"The contents of this e-mail (including any attachments) may be confidential and/or subject to copyright. Any unauthorised use, 
distribution, or copying of the contents is expressly prohibited.  If you have received this e-mail in error, please advise the sender 
by return e-mail or telephone and then delete this e-mail together with all attachments from your system."