A simple script to check for SFO GlobalEntry interview timeslots.
People sometimes cancel their interviews, leaving a new opening for someone else to schedule themselves into. Most openings are snapped up within a few minutes (or faster). So I recommend opening the TTP login page and babysitting the script for a few hours while doing something else on your computer. Be ready to act the moment a good time opens up!
There are other tools out there that do the same thing, but they cost money :(
This script is built to check for availability once per minute and log the results to a Discord webhook. The reason for sending it to Discord was for push notification support!
- Clone this repository
git clone https://github.com/benrucker/sf-globalentry-watcher
- Navigate to the repo
cd sf-globalentry-watcher
- Install the dependencies
npm install
- Make a new file called
.env
- Generate a Discord webhook URL
- Right click a text channel and click "Edit Channel"
- Go to "Integrations" -> "Webhooks" -> "New Webhook" -> "Copy Webhook URL"
- Paste the URL in
.env
followingWEBHOOK_URL=
(with quotes around it)
WEBHOOK_URL="https://discord.com/api/webhooks/<CHANNEL ID>/<TOKEN>"
- Testrun the application
npm run dev
# or
ts-node-esm src/index
- The program should hit the API and send a message to the webhook with a time (like
"Next slot: Wed Sep 13 2023 at 7:30 AM"
) or a notice that no times are available (like"No time slot available"
)
Instructions for automatically checking the status every minute.
- Make a file called
cron-runnable.sh
with these contents:
#!/usr/bin/env sh
PATH=PASTE_PATH_HERE
npm run dev
- Run
echo $PATH
, copy and paste the output to the second line ofcron-runnable.sh
cron
doesn't use your user's path when executing commands, despite using your user's permissions level
- Run
crontab -e
- Enter something like this line:
* * * * * cd /absolute/path/to/sf-globalentry-watcher && ./cron-runnable.sh > /tmp/ge-watcher.log 2>&1
# The asterisks mean "At every minute, run the command"
# You could instead change them to `0 * * * *` which would mean "On every hour, run the command"
- Live monitor the script output with
watch /tmp/ge-watcher.log
You don't have to use
cron
, of course - feel free to run this in a loop in your terminal. Just don't DoS the server; you know how fragile government websites can be!