GreaseMonkey: CiteULike
GreaseMonkey script for copying to myLib and for linking to Duke PDFs
GreaseMonkey allows the user to run arbitrary Javascript scripts before or after a page is loaded. The admins will cry faul, because few things could be more threatening to security. Modern browsers allow javascript to connect to arbitrary URL, and GM made it as easy as it can be. Any user can install GM scripts from unknown websites. It’s simply an anarchy.
Which is why I hail it. It gives the user the ultimate freedom to consume web information in ways that make sense to him/her.
My short-term plan is to use GM as a front end to citeulike.org, so as to get around developing "plug-ins" in *NIX+Tcl environment. Tcl is cool, but currently their script does not run on Windows. As a matter of principle I think it’s better to do info grabbing at the client side, not the server side.
In the long run, though, AJAX-based interface should replace the current citeulike. I can use GM to search, post, modify entries on a server, and update the client side using AJAX. The server, then, becomes a backend, something like a XMLRPC server, although probably even simpler. User interface, sorting, editing (wiki-like), and posting are all done at the client side using GM/AJAX.
First step, I did the following GM User script, which adds a "get it @ Duke" link besides every CiteULike entry. It basically grabs the Z3988 search string embedded in Citeulike and rewrites it as appropriate URLs (Duke’s CitationLinker). In fact, I experimented with a more complex approach (going through 2 http requests) before figuring out a direct way to do it.
Her is the script (if you have installed GreaseMonkey, right click on the link and install the script): GreaseMonkey script for searching Duke fulltext articles
New feature: automatic ISSN search.
If the Z3988 string does not have ISSN, and this is a journal article, then find the ISSN via duke library’s e-journal search page and add it to the Z3988 string. Otherwise Duke’s SFX can’t resolve the right article. Occassionally Duke doesn’t have the ISSN but DOI link still works. A message "ISSN not found at Duke" will be displayed along with the Get@Duke icon.
So in terms of CiteULike->Duke, this script is pretty much all set.
What’s needed is to go from Publisher->CiteUlike and to download PDF. This requires publisher-specific code to extract relevant info.
[update Spet 20, 2006]: Added AJAX one-click "copy to my library" button.
Copying an interesting article entry your library requires going through at least 2 pages, which means also you have to joggle with 2 browser windows or to click "Back" buttons all the time.
To simplify the process, this script adds a tag input field and a button to any biblio entries on CUL that is not YOURS. Add tags and click the button, the entry is posted to your library, with your new tags, in the background. If everything goes well, it displays "Done!" in the tag field. Because it’s AJAX, you can work on as many entries as you want at the same time.
To-dos: adding notes? Using a true AJAX field — click on a button to activate the DIV, set the articleID, etc., and post, instead of having tons of buttons.
to-do:
- Use the CrossRef ISSN search engine: it’s slow but comprehensive.
- use the CrossRef DOI resolver and DOI Lookup: again, slow but complete.
- Need a better GUI: create another DIV to display the link info: fulltext availability and alternative locations
- Need to jump 1 http request hoop to find out whether fulltext is available: the SFX page should show whether Fulltext is available
- Need to add a link to the fulltext page: "post to CUL" with or without automatical PDF downloading/uploading. <– calling a PHP script which download and upload PDF files automatically. This can be tricky.
- Does CiteULike provide an API to post ref info? Does the manual post have all the fields needed? DOI is separate. <– consider writing a plug-in that takes Z3988 info and create an entry (looking up DOI and resolve DOI). The Z3988-2004 info is dynamically created in GreaseMonkey by extracting info on the publisher’s webpage
- Figure out a general structure so that we can deal with different publishers, etc.
A couple of days ago I also did the following UserScript to do show availability of an Amazon book in duke library: http://www.garyfeng.com/wordpress/wp-content/DukeLibISBNLookup.user.js
Other useful extensions:
- Platypus allows you to edit a page and save the changes as a GreaseMonkey user script. This is sort like what some of the web sticky does. It is essentially the StandardBrains editor plus more. It would be used as a frontend of a wiki-like system for notetaking.
- View Rendered Source is a Firefox extension that display color-coded, formatted and styled HTML source.
[ To be updated … ]