Git Product home page Git Product logo

sf-globalentry-watcher's Introduction

SFO GlobalEntry Watcher

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 :(

Usage

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!

Setup

  1. Clone this repository
git clone https://github.com/benrucker/sf-globalentry-watcher
  1. Navigate to the repo
cd sf-globalentry-watcher
  1. Install the dependencies
npm install
  1. Make a new file called .env
  2. Generate a Discord webhook URL
    1. Right click a text channel and click "Edit Channel"
    2. Go to "Integrations" -> "Webhooks" -> "New Webhook" -> "Copy Webhook URL"
  3. Paste the URL in .env following WEBHOOK_URL= (with quotes around it)
WEBHOOK_URL="https://discord.com/api/webhooks/<CHANNEL ID>/<TOKEN>"
  1. Testrun the application
npm run dev
# or
ts-node-esm src/index
  1. 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")

Cron setup

Instructions for automatically checking the status every minute.

  1. Make a file called cron-runnable.sh with these contents:
#!/usr/bin/env sh
PATH=PASTE_PATH_HERE
npm run dev
  1. Run echo $PATH, copy and paste the output to the second line of cron-runnable.sh
    • cron doesn't use your user's path when executing commands, despite using your user's permissions level
  2. Run crontab -e
  3. 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"
  1. 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!

sf-globalentry-watcher's People

Contributors

benrucker avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.