Sign in or Join FriendFeed
FriendFeed is the easiest way to share online. Learn more »
Mike Chelen
"Links any Document Object Identifiers for resolution with http://dx.doi.org" - Mike Chelen from Bookmarklet
currently works with plaintext DOIs like http://www.plosone.org/article... and with DOI class spans like http://www.nature.com/nature... - Mike Chelen
RegExp missing some chars, e.g., % if URL-encoded. We tend to use 10\.(?:\d{4})/(?:[^ "'<&]+) but that can break too - it's annoying that the DOI spec doesn't limit the chars allowed! This is for searching the whole text (incl. within href), not element-wise so might not suit your code exactly. - Fergus Gallagher
Fergus: going to take a look and give that a try, probably only will try to work with displayed text, but it might be cool to add compatibility with any kind of field attribute or xhtml. thanks! - Mike Chelen
One special case worth looking for is "COiNS" OpenURL. Our (jQuery) code is var z = jQuery(".Z3988:eq(0)"); if (z.length) { var r = z.attr("title").split("&"); for (var i=0; i<r.length; i++) { var x = decodeURIComponent(r[i]); if (/^rft_id=info:doi\/.*?(10\.\d\d\d\d\/.*)/.exec(x)) { var doi = RegExp.$1; doSomething(doi); return; } } } - Fergus Gallagher