Each week, searches the legal source you name for your research question and records each decision's court, date and outcome in a sheet.
Uses
Claude
Google Sheets
Jina AI
Serper
Keep a sheet of new court decisions on your research question
sheetUrl to blank.Set sheetUrl to blank.researchQuestion to blank.Set researchQuestion to blank.sourceHost to blank.Set sourceHost to blank.recordsTab to Case notes.Set recordsTab to Case notes.maxCasesPerRun to 5.Set maxCasesPerRun to 5.sourceHost lowercase and save it as hostRaw.Make sourceHost lowercase and save it as hostRaw.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.hostNoScheme split by / and save it as host.Get the first item of hostNoScheme split by / and save it as host.host is emptyIf host is emptyYes
No
No steps
urlPrefix to https://@host/.Set urlPrefix to https://@host/.recordedOn.Get today's date and save it as recordedOn.alreadyRecorded.Start an empty list and save it as alreadyRecorded.recordsTabErrorIf a step below fails, save the error as recordsTabErrorTry
sheetUrl. Save it as done.Read the rows of sheetUrl. Save it as done.doneRow in done.rows:For each doneRow in done.rows:doneRow.Source and save it as doneSource. Trim doneRow.Source and save it as doneSource.doneSource in lowercase starts with https:// If doneSource in lowercase starts with https://Yes
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
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..host'. Save it as found.Search Google for '@researchQuestion site:host'. Save it as found.recorded to 0.Set recorded to 0.result in found.results:For each result in found.results: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
No
No steps
result.link and save it as link.Trim result.link and save it as link.link in lowercase doesn't start with urlPrefixIf link in lowercase doesn't start with urlPrefixYes
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.No
No steps
alreadyRecorded contains linkIf alreadyRecorded contains linkYes
No
No steps
recorded.Add 1 to recorded.resultErrorIf a step below fails, save the error as resultErrorTry
link with Jina. Save it as page.Read the page at link with Jina. Save it as page.page.content and save it as pageText.Trim page.content and save it as pageText.pageText is less than 400If the length of pageText is less than 400Yes
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
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.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.prompt. Save it as reply.Ask Claude: prompt. Save it as reply.
Maximum response length: 900reply.response_text and save it as answer.Trim reply.response_text and save it as answer.answer by ||| and save it as parts.Split answer by ||| and save it as parts.parts is less than 6If the length of parts is less than 6Yes
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
parts[0] and save it as caseName.Trim parts[0] and save it as caseName.caseName is null or caseName in lowercase is not statedIf caseName is null or caseName in lowercase is not statedYes
caseName to blank.Change caseName to blank.No
No steps
parts[1] and save it as citation.Trim parts[1] and save it as citation.citation is null or citation in lowercase is not statedIf citation is null or citation in lowercase is not statedYes
citation to blank.Change citation to blank.No
No steps
parts[2] and save it as court.Trim parts[2] and save it as court.court is null or court in lowercase is not statedIf court is null or court in lowercase is not statedYes
court to blank.Change court to blank.No
No steps
parts[3] and save it as decided.Trim parts[3] and save it as decided.decided is null or decided in lowercase is not statedIf decided is null or decided in lowercase is not statedYes
decided to blank.Change decided to blank.No
No steps
parts[4] and save it as outcome.Trim parts[4] and save it as outcome.outcome is null or outcome in lowercase is not statedIf outcome is null or outcome in lowercase is not statedYes
outcome to blank.Change outcome to blank.No
No steps
parts[5] and save it as quote.Trim parts[5] and save it as quote.quote is null or quote in lowercase is not statedIf quote is null or quote in lowercase is not statedYes
quote to blank.Change quote to blank.No
No steps
notStated to blank.Set notStated to blank.integrity to blank.Set integrity to blank.missing.Start an empty list and save it as missing.caseName is emptyIf caseName is emptyYes
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
citation is emptyIf citation is emptyYes
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
court is emptyIf court is emptyYes
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
decided is emptyIf decided is emptyYes
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
outcome is emptyIf outcome is emptyYes
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
missing isn't emptyIf missing isn't emptyYes
notStated to The page did not state: missing joined by , .Change notStated to The page did not state: missing joined by , .No
No steps
verified to false.Set verified to false.quote is greater than or equal to 25If the length of quote is greater than or equal to 25Yes
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
verified is noIf verified is noYes
quote to blank.Change quote to blank.outcome to blank.Change outcome to blank.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
notStated integrity and save it as notes.Trim notStated integrity and save it as notes.recordsTab in sheetUrl.Add a row to recordsTab in sheetUrl.On error
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.