Juriscraper meets JavaScript

JuriscraperJS repo page

As I mentioned in the last post, Mike Lissner at the CourtListener project has written a really splendid parser for case citations. I’ve taken the liberty of recasting the code of the current version from the original Python to Javascript, and put it up on BitBucket under the tentative name “JuriscraperJS”. To visit the repository, click on the illustration to the right. The JavaScript code covers only the text scraping element of the full CourtListener Juriscraper system. I haven’t spoken with Mike yet; if there is a risk of confusion we might end up calling the refactored code something else.

The JavaScript object weighs in at 3,762 lines, most of which is taken up by detailed structured descriptions of individual reporters. To take the code out for a trial run, you can install the ExecuteJS plugin in Firefox, open an ExecuteJS dialog, and paste the code from juriscraper.js into “JS-Code to execute” box. You can uncomment the block of code at the bottom of the file for a quick demo: it assumes that you have Zotero or Multilingual Zotero installed, and that you have a means of reading the console log.

The output of the sample code is shown to the right. As you can see, the scraper produces a nice fine-grained record of basic metadata. Given an openSearch query channel such as that demonstrated in the previous post, this data can be used to retrieve a copy of the case. With a relatively small amount of work to add a supporting user interface to Multilingual Zotero, one click can call up a list of cases cited in a judgment, and a second can call up the case text itself.

Some further work will be needed to tie this together, but just as site translators provide a uniform interface to disparate content on the Web, client-side citation parsing can provide a uniform link layer on case law drawn from scattered sources. This could get interesting.

This entry was posted in Announcements. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>