Skip to content

Instantly share code, notes, and snippets.

@sirhc
Created July 2, 2023 19:38
Show Gist options
  • Save sirhc/93fb796ab98840380b80e2b582cff1cc to your computer and use it in GitHub Desktop.
Save sirhc/93fb796ab98840380b80e2b582cff1cc to your computer and use it in GitHub Desktop.
#!/bin/bash
set -euo pipefail
IFS=$'\t\n'
cookie_jar="$(mktemp)"
trap 'rm -f "$cookie_jar"' EXIT
ejuror_url='https://ecf.casd.uscourts.gov/ejuror/TransportRoom'
args=(
--cookie-jar "$cookie_jar"
--cookie "$cookie_jar"
--silent
)
data='semaphore=semaphore&partNumber=103902276&first3=GRA&birthMonth=01&birthDay=08&birthYear=1977'
# Initialize cookies.
curl "${ejuror_url}?servlet=login" "${args[@]}" >/dev/null
# Log in.
curl "${ejuror_url}?servlet=login" "${args[@]}" --data "$data" >/dev/null
# Report status.
curl "${ejuror_url}?servlet=workflowshowStatus" "${args[@]}" \
| pup 'form#statusCommand' \
| w3m -dump -T text/html \
| jq --slurp --raw-input '{"message": .}' \
| curl 'https://f27ecb9d24e85bb2640dd19b8fbe8a90.m.pipedream.net' --silent --header 'Content-Type: application/json' --data '@-'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment