Skip to content

Commit

Permalink
Refer to 'Trusted Traveler Program' instead of 'Global Entry', update…
Browse files Browse the repository at this point in the history
… docs
  • Loading branch information
tjd2002 committed May 8, 2019
1 parent da1095e commit 85d23f4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
# goes-notify

This app will simply parse json output from the interview scheduler for many of CBP's Trusted Traveler Programs, including Global Entry, NEXUS, SENTRI, US/Mexico FAST, and US/Canada FAST. You don't need to provide a login, it will simply check the available dates against your current interview date, then notify you if a better date can be locked in.
This app will simply parse json output from the interview scheduler for many of CBP's Trusted Traveler Programs, including Global Entry, NEXUS, SENTRI, US/Mexico FAST, and US/Canada FAST. You don't need to provide a login, it will simply check the available dates against your current interview date, then notify you if an earlier date is available.

Based on the ge-cancellation-checker that originally utilized phantomjs to login as the user:
https://github.com/davidofwatkins/ge-cancellation-checker

# Getting started

- Clone the repo
- Install the requirements: `pip install -r requirements.txt`
- Copy or rename `config.json.example` to `config.json`
- `cp config.json.example config.json`
- Enter required fields into `config.json`:
- Look up your enrolment center in the list below
- Enter your current interview date, in a format e.g. "December 10, 2017"
- Look up your appointment location in the list below
- Enter your current interview date, in a format like "December 10, 2017"

# Usage

Run the script with `python`: `python2 goes-notify.py`
Run the script with `python`: `python goes-notify.py` (python2 or 3 OK)

If you're running this on a machine you'll be using while it's searching, you can pass `--no-email` and receive a local macOS notification when the script finds a new appointment.
If you're running this on a machine that you'll be using while it's searching, you can set `notify_osx` to True in the config file and receive a local macOS notification when the script finds a new appointment.

With `--use-gmail`, you can send yourself an email when an appointment is found. Note: if you have two-factor authentication enabled for your account, you'll need to [generate an app-specific password](https://myaccount.google.com/apppasswords) and add that to `config.json`.

Expand Down
8 changes: 4 additions & 4 deletions goes-notify.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from email.mime.multipart import MIMEMultipart

EMAIL_TEMPLATE = """
<p>Good news! New Global Entry appointment(s) available on the following dates:</p>
<p>Good news! New Trusted Traveler Program appointment(s) available on the following dates:</p>
%s
<p>Your current appointment is on %s</p>
<p>If this sounds good, please sign in to https://ttp.cbp.dhs.gov/ to reschedule.</p>
Expand Down Expand Up @@ -50,7 +50,7 @@ def notify_send_email(dates, current_apt, settings, use_gmail=False):
if username:
server.login(username, password)

subject = "Alert: Global Entry interview openings are available"
subject = "Alert: Trusted Traveler Program interview openings are available"

dateshtml = '<ul>'
for d in dates:
Expand All @@ -76,7 +76,7 @@ def notify_send_email(dates, current_apt, settings, use_gmail=False):

def notify_osx(msg):
logging.info('Sending OS X notification.')
call(['osascript', '-e', 'display notification \"%s\" with title \"Global Entry Notifier\"' % msg])
call(['osascript', '-e', 'display notification \"%s\" with title \"Trusted Traveler Appointment Notifier\"' % msg])

def notify_sms(settings, dates):
for avail_apt in dates:
Expand All @@ -99,7 +99,7 @@ def notify_sms(settings, dates):
# Twilio logs annoyingly, silence that
logging.getLogger('twilio').setLevel(logging.WARNING)
client = Client(account_sid, auth_token)
body = 'New GOES appointment available on %s' % avail_apt
body = 'New GOES/TTP appointment available on %s' % avail_apt
logging.info('Sending SMS.')
client.messages.create(body=body, to=to_number, from_=from_number)

Expand Down

0 comments on commit 85d23f4

Please sign in to comment.