Final command
Change {your-case-id} to the case ID looks like "IOE123412341234"
while true; do echo '----------------------------------------'; date; curl -s https://egov.uscis.gov/casestatus/mycasestatus.do\?appReceiptNum\={your-case-id} | pup 'h1 text{}'; sleep 300; done
Example output:
---------------------------------------
Sat Jun 11 09:10:10 PDT 2022
Case Is Being Actively Reviewed By USCIS
---------------------------------------
Sat Jun 11 09:15:12 PDT 2022
Case Is Being Actively Reviewed By USCIS
---------------------------------------
Sat Jun 11 09:20:13 PDT 2022
Case Is Being Actively Reviewed By USCIS
---------------------------------------
Sat Jun 11 09:25:14 PDT 2022
Case Is Being Actively Reviewed By USCIS
Explaination
Every 5 mins...
while true; do {your-commands} sleep 300; done
Print the current time
date
Curl DOM of a web page
curl -s {url}
-s
flag is to "silent" the progress bar printing.
DOM navigation
pup {selector}
- pup: https://github.com/ericchiang/pup
- to install:
brew install pup
- to install:
h1
is the css selector- it can be a tag name like
h1
- or it can be dom id like
#id
- or class name
.class
- it can be a tag name like
text{}
can fetch the text inside of the dom object- without this the output looks like
<h1>Your case is actively reviewed by USCIS</h1>
- with this the output looks like
Your case is actively reviewed by USCIS
- without this the output looks like