Each week, searches the legal source you name for your research question and records each decision's court, date and outcome in a sheet.

UsesClaudeGoogle SheetsJina AISerper

Keep a sheet of new court decisions on your research question

Once a week, your standing research question is searched on the one legal website you name, each decision found there is opened, and what the page states is copied into a row of your spreadsheet. It is a research aid, not legal advice, and it never says what a case means or how it applies.

You end up with one row per case in a 'Case notes' tab: case name, citation, court, decision date, the outcome as the page states it, a quoted passage, the source address and a note of what the page did not say. Only pages on the site you named are ever opened. Anything the page does not state is left empty, never guessed, and the quoted passage is checked against the text actually fetched: if those words are not on the page, the quote and outcome are emptied and the row says so. Cases already recorded are skipped, and each run reads a capped number of pages.

Before the first run you need a spreadsheet with a 'Case notes' tab, a research question, and the host name of the one site to read.

Run every 7 days.Run every 7 days.
Set sheetUrl to blank.Set sheetUrl to blank.
Set researchQuestion to blank.Set researchQuestion to blank.
Set sourceHost to blank.Set sourceHost to blank.
Set recordsTab to “Case notes”.Set recordsTab to “Case notes”.
Set maxCasesPerRun to 5.Set maxCasesPerRun to 5.
TextMake sourceHost lowercase and save it as hostRaw.Make sourceHost lowercase and save it as hostRaw.
Replace “http://” with “” in hostRaw with “https://” replaced by “” and save it as hostNoScheme.Replace “http://” with “” in hostRaw with “https://” replaced by “” and save it as hostNoScheme.
Get the first item of hostNoScheme split by “/” and save it as host.Get the first item of hostNoScheme split by “/” and save it as host.
If host is emptyIf host is empty
Yes
Stop and report a problem: The 'sourceHost' step does not look like a website address. Enter just the host, exactly as it appears in that site's own web addresses - for example 'www.bailii.org'.Stop and report a problem: The 'sourceHost' step does not look like a website address. Enter just the host, exactly as it appears in that site's own web addresses - for example 'www.bailii.org'.
No
No steps
Set urlPrefix to “https://@host/”.Set urlPrefix to “https://@host/”.
Get today's date and save it as recordedOn.Get today's date and save it as recordedOn.
Start an empty list and save it as alreadyRecorded.Start an empty list and save it as alreadyRecorded.
If a step below fails, save the error as recordsTabErrorIf a step below fails, save the error as recordsTabError
Try
Google SheetsGoogle SheetsRead the rows of sheetUrl. Save it as done.Read the rows of sheetUrl. Save it as done.
For each doneRow in done.rows:For each doneRow in done.rows:
Trim doneRow.Source and save it as doneSource. Trim doneRow.Source and save it as doneSource.
If doneSource in lowercase starts with “https://” If doneSource in lowercase starts with “https://”
Yes
Add doneSource to the end of alreadyRecorded and save it as alreadyRecorded.Add doneSource to the end of alreadyRecorded and save it as alreadyRecorded.
No
No steps
On error
Show in the output: “Could not read the 'Case notes' tab, so this run treated it as empty. If that tab does not exist yet, create it.”.Show in the output: “Could not read the 'Case notes' tab, so this run treated it as empty. If that tab does not exist yet, create it.”.
SerperSerperSearch Google for '@researchQuestion site:host'. Save it as found.Search Google for '@researchQuestion site:host'. Save it as found.
Set recorded to 0.Set recorded to 0.
For each result in found.results:For each result in found.results:
If recorded multiplied by 1 is greater than or equal to maxCasesPerRun multiplied…If recorded multiplied by 1 is greater than or equal to maxCasesPerRun multiplied…
Yes
Stop repeating.Stop repeating.
No
No steps
Trim result.link and save it as link.Trim result.link and save it as link.
If link in lowercase doesn't start with urlPrefixIf link in lowercase doesn't start with urlPrefix
Yes
Show in the output: Skipped link - it is not on the site named in the 'sourceHost' step.Show in the output: Skipped link - it is not on the site named in the 'sourceHost' step.
Skip to the next item.Skip to the next item.
No
No steps
If alreadyRecorded contains linkIf alreadyRecorded contains link
Yes
Skip to the next item.Skip to the next item.
No
No steps
Add 1 to recorded.Add 1 to recorded.
If a step below fails, save the error as resultErrorIf a step below fails, save the error as resultError
Try
Jina AIJina AIRead the page at link with Jina. Save it as page.Read the page at link with Jina. Save it as page.
Trim page.content and save it as pageText.Trim page.content and save it as pageText.
If the length of pageText is less than 400If the length of pageText is less than 400
Yes
Show in the output: Nothing was recorded for link - the page had no readable text. It will be tried again on the next run.Show in the output: Nothing was recorded for link - the page had no readable text. It will be tried again on the next run.
No
Set pageSection to PAGE TEXT - this is the only material you may use:Set pageSection to PAGE TEXT - this is the only material you may use: pageText truncated to 16000 characters.
Set prompt to You are copying details out of one page of legal material into a record. You have the text of that page and nothing else.Set prompt to You are copying details out of one page of legal material into a record. You have the text of that page and nothing else. Answer with EXACTLY six values separated by ||| and nothing else - no labels, no numbering, no preamble. 1. The name of the case, as the page gives it. 2. The citation, as the page gives it. 3. The court, as the page names it. 4. The date of the decision, as the page gives it. 5. What the page states the outcome was, in one sentence, in the page's own terms. 6. One passage from the page, copied word for word and character for character, that carries the outcome you gave in value 5. Copy it exactly - do not tidy it, shorten it, join its lines or change its punctuation. Rules you must follow, without exception: - Use only the page text below. Do not use anything you know about this case, this court, or this area of law from anywhere else. - If the page does not state something, write exactly NOT STATED for that value. A missing value is a correct answer; an invented one is not. Never produce a citation, a date or a court name that does not appear in the text below. - Do not say what the case means, what it establishes, how it applies to anyone, or what a court would do. Report only what this page states. - Do not write advice of any kind. pageSection.
ClaudeClaudeAsk Claude: prompt. Save it as reply.Ask Claude: prompt. Save it as reply. Maximum response length: 900
Trim reply.response_text and save it as answer.Trim reply.response_text and save it as answer.
Split answer by “|||” and save it as parts.Split answer by “|||” and save it as parts.
If the length of parts is less than 6If the length of parts is less than 6
Yes
Show in the output: Nothing was recorded for link - the reading step did not answer in the expected form. Nothing was recorded, and it will be tried again on the next run.Show in the output: Nothing was recorded for link - the reading step did not answer in the expected form. Nothing was recorded, and it will be tried again on the next run.
No
Trim parts[0] and save it as caseName.Trim parts[0] and save it as caseName.
If caseName is “null” or caseName in lowercase is “not stated”If caseName is “null” or caseName in lowercase is “not stated”
Yes
Change caseName to blank.Change caseName to blank.
No
No steps
Trim parts[1] and save it as citation.Trim parts[1] and save it as citation.
If citation is “null” or citation in lowercase is “not stated”If citation is “null” or citation in lowercase is “not stated”
Yes
Change citation to blank.Change citation to blank.
No
No steps
Trim parts[2] and save it as court.Trim parts[2] and save it as court.
If court is “null” or court in lowercase is “not stated”If court is “null” or court in lowercase is “not stated”
Yes
Change court to blank.Change court to blank.
No
No steps
Trim parts[3] and save it as decided.Trim parts[3] and save it as decided.
If decided is “null” or decided in lowercase is “not stated”If decided is “null” or decided in lowercase is “not stated”
Yes
Change decided to blank.Change decided to blank.
No
No steps
Trim parts[4] and save it as outcome.Trim parts[4] and save it as outcome.
If outcome is “null” or outcome in lowercase is “not stated”If outcome is “null” or outcome in lowercase is “not stated”
Yes
Change outcome to blank.Change outcome to blank.
No
No steps
Trim parts[5] and save it as quote.Trim parts[5] and save it as quote.
If quote is “null” or quote in lowercase is “not stated”If quote is “null” or quote in lowercase is “not stated”
Yes
Change quote to blank.Change quote to blank.
No
No steps
Set notStated to blank.Set notStated to blank.
Set integrity to blank.Set integrity to blank.
Start an empty list and save it as missing.Start an empty list and save it as missing.
If caseName is emptyIf caseName is empty
Yes
Add “the case name” to the end of missing and save it as missing.Add “the case name” to the end of missing and save it as missing.
No
No steps
If citation is emptyIf citation is empty
Yes
Add “the citation” to the end of missing and save it as missing.Add “the citation” to the end of missing and save it as missing.
No
No steps
If court is emptyIf court is empty
Yes
Add “the court” to the end of missing and save it as missing.Add “the court” to the end of missing and save it as missing.
No
No steps
If decided is emptyIf decided is empty
Yes
Add “the decision date” to the end of missing and save it as missing.Add “the decision date” to the end of missing and save it as missing.
No
No steps
If outcome is emptyIf outcome is empty
Yes
Add “the outcome” to the end of missing and save it as missing.Add “the outcome” to the end of missing and save it as missing.
No
No steps
If missing isn't emptyIf missing isn't empty
Yes
Change notStated to “The page did not state: missing joined by “, ”.”.Change notStated to “The page did not state: missing joined by “, ”.”.
No
No steps
Set verified to false.Set verified to false.
If the length of quote is greater than or equal to 25If the length of quote is greater than or equal to 25
Yes
Check whether pageText contains quote (ignoring case) and save it as verified.Check whether pageText contains quote (ignoring case) and save it as verified.
No
No steps
If verified is noIf verified is no
Yes
Change quote to blank.Change quote to blank.
Change outcome to blank.Change outcome to blank.
Change integrity to “The outcome column was left empty: no passage in the page's own text could be found to support it. Open the Source link and read the decision itself.”.Change integrity to “The outcome column was left empty: no passage in the page's own text could be found to support it. Open the Source link and read the decision itself.”.
No
No steps
Trim notStated integrity and save it as notes.Trim notStated integrity and save it as notes.
Google SheetsGoogle SheetsAdd a row to recordsTab in sheetUrl.Add a row to recordsTab in sheetUrl.
On error
Show in the output: Nothing was recorded for link this time; it will be tried again on the next run.Show in the output: Nothing was recorded for link this time; it will be tried again on the next run.