UHM CS proxy converter Bookmarklet source
Update: Don’t use this bookmarklet, use the better one discussed here.
This is the source for the bookmarklet I wrote to switch to the UH Manoa proxy for some sites that are useful to computer scientists. The first comment line has the source converted into a form that can be pasted into the location field of a browser or pasted into the URL field of a bookmark.
// javascript:void((function(){switch%20(location.host)%20{case%20%22ieeexplore.ieee.org%22:location.href=location.href.replace(/^http\:\/\/([^\/\@]+)\/(?:)/,%22http://micro189.lib3.hawaii.edu:2393/%22);break;case%20%22portal.acm.org%22:location.href=location.href.replace(/^http\:\/\/([^\/\@]+)\/(?:)/,%22http://micro189.lib3.hawaii.edu:2540/%22);break;case%20%22safari.oreilly.com%22:location.href=location.href.replace(/^http\:\/\/([^\/\@]+)\/(?:)/,%22http://micro189.lib3.hawaii.edu:3217/%22);break;default:alert(%22Current%20page%20is%20not%20IEEE%20Xplore,%20ACM%20Digital%20Library,%20or%20Safari%20Online,%20no%20action%20taken%22);}})())
// Redirects from IEEE Xplore, ACM Digital Library, or Safari Books Online sites to the
// University of Hawaii proxy that allows UH users full access.
void(
(function(){
switch (location.host) {
case "ieeexplore.ieee.org":
location.href=location.href.replace(
/^http\:\/\/([^\/\@]+)\/(?:)/,
"http://micro189.lib3.hawaii.edu:2393/");
break;
case "portal.acm.org":
location.href=location.href.replace(
/^http\:\/\/([^\/\@]+)\/(?:)/,
"http://micro189.lib3.hawaii.edu:2540/");
break;
case "safari.oreilly.com":
location.href=location.href.replace(
/^http\:\/\/([^\/\@]+)\/(?:)/,
"http://micro189.lib3.hawaii.edu:3217/");
break;
default:
alert("Current page is not IEEE Xplore, ACM Digital Library, or Safari Online, no action taken");
}
})()
)


October 4, 2007 at 2:44 am |
[...] so there is no way to provide it directly from this blog entry! Bleagh. So here is a link to the Javascript source, and here is an external web page containing the bookmarklet. As an added bonus I have added [...]