Created
May 2, 2021 22:39
-
-
Save sirhc/1e282ff51621771e638b50bfb2290f8f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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=#########&first3=XXX&birthMonth=##&birthDay=##&birthYear=####' | |
# 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://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.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
The Pipedream hook forwards the message to me in Slack.
I'm running it on my server as,