Wednesday, February 23, 2011

A bookmarklet for shortDOI.org

shortDOI is a URL shortening service that takes DOIs and converts them to short URLs such as http://doi.org/bb6, which is nice for emails and Twitter. You can add the bookmarklet by dragging this link to your bookmarks: shortDOI. It will try to find the DOI in the current page and direct you to shortDOI.


A shortDOI URL is probably more persistent than, say, bit.ly, as it's backed by the organization that maintains the DOI infrastructure. However, if doi.org would go down, you could always use a search engine if you have the original DOI, but the shortDOI URL will be worthless.

Update 24.02.2011: Use some majority voting to find the right DOI.
Update 01.03.2011: Expand the list of allowed characters. Does anybody know which characters can be part of the DOI?
Update 29.07.2015: Be strict about having a prefix and suffix. First check for the "citation_doi" meta tag before looking in the rest of the document.

6 comments:

dullhunk said...

Hi Michael, nice idea and it works well.

It seems to struggle on some nature pages though, claiming there is more than one DOI on the page...

e.g.
http://www.nature.com/nature/journal/v470/n7335/full/nature09704.html

Michael Kuhn said...

Hi Duncan,

the reason was the Nature page is full of the references' DOIs. I've changed the bookmarklet to use majority voting, i.e. it'll take the most common DOI (which is hopefully the correct one).

matthis said...

Worked for a couple of examples I tried,
but failed for the following examples:
http://onlinelibrary.wiley.com/doi/10.1002/ceat.201400796/abstract
http://link.springer.com/article/10.1134/S0018151X15020030

Michael Kuhn said...

Hi Matthis,

thanks for checking it out! I fixed the bookmarklet. As it turns out, many journal articles have a dedicated tag nowadays, which makes extraction of the DOI even easier. It now works for both your examples.

matthis said...

Hi,
thanks for the update! I can confirm that the code from the gist does now work. If you also update the link in the blog post, installing the bookmarklet will be as easy as before (just dragging it to the bookmark bar).
Cheers,
Matthis

Michael Kuhn said...

Ah, thanks for the reminder!