davidofwatkins / ge-cancellation-checker

A PhantomJS script that checks your GOES account for a sooner Global Entry enrollment appointment
173 stars 74 forks source link

GOES site redesign #41

Open drocus opened 6 years ago

drocus commented 6 years ago

I just got the script working! YAY. Unfortunately TSA redesigned their site recently and this script no longer works with the new design. At least not that I can make happen. Anyone want to fix it?

Drewster727 commented 6 years ago

just saw this too... damn...

Drewster727 commented 6 years ago

So, I could update this, but I'd need a suggestion from someone on how to get past the "pin" request. i.e. when you login it sends a text to your phone with a pin number to authenticate you.

derekmtran commented 6 years ago

Perhaps change the script so it doesn't re-log in every time? Maybe if we keep the headless browser open after initial login, it won't be so bad to:

Thoughts?

Drewster727 commented 6 years ago

It's a good idea, but would make the python script a bit more complicated. The script would have to keep the session active, so it'd have to reload the page every so often. Additionally, this would break the "cron" functionality to run it as a scheduled task. It becomes more of a service as this point.

ricetim commented 6 years ago

It's actually so much easier than that. You can send a GET to access the first available time at any given site if you know the site ID (easily pulled from the schedule page). Here's JFK, for example: https://ttp.cbp.dhs.gov/schedulerapi/slots?orderBy=soonest&limit=1&locationId=5140&minimum=1

mbgearhead commented 6 years ago

Well, there are a few issues. DHS added support for:

I agree with derekmtran's approach to use a single session that never logs out, but I think that Drewster727 is correct that this would break the current cron functionality. My idea would be to create a systemd background job that is initialized by the user that checks for cancellations at a specified interval. The interval could be modified in a config file along with airports with specific date ranges. Both the 2FA otp and the CAPTCHA could be handled by the user during script startup.

mbgearhead commented 6 years ago

With darkside's info, it seems absolutely possible to build a cancellation checker using DHS GOES new API without login (woohoo!). Seems that it has already been done in an npm-based app https://porter.io/github.com/oliversong/goes-notifier. Perhaps we should use the code-base to work towards automating the sign-up for an earlier appointment?

Drewster727 commented 6 years ago

@Darkside- well i'll be damned... good find!

Drewster727 commented 6 years ago

@mbgearhead I looked at oliversong's goes-notifier here: https://github.com/oliversong/goes-notifier

it's 10 months old and targets the old .jsp site just like this one does. It will have the same issues. Am I missing something?

With darkside's API we can write a stupid simple script that just hits the json api and sends off a notification.

mbgearhead commented 6 years ago

Sorry, the way I wrote my response it made it sound I wanted to copy Oliver's code. I meant perhaps we could build upon the existing ge-cancellation checker code to work toward adding a feature where the newly available appointment is automatically accepted once an opening is found (I'm assuming we'll use the fix that @Darkside suggested to find the opening).

ricetim commented 6 years ago

You don't need to even write your own code. I'm using a Chrome extension that monitors webpages for changes and just have it check the airport that I'm interested in every few minutes. It pops up an alert on my desktop if it detects any change.

ricetim commented 6 years ago

Already had one success. Checking earlier today the only open slot was July 2018, now I've been alerted that there's an availability next Monday.

Drewster727 commented 6 years ago

https://github.com/Drewster727/goes-notify

enjoy!

mbgearhead commented 6 years ago

Awesome! Nice job @Drewster727

davidofwatkins commented 6 years ago

Excellently done, @Drewster727! I've gone ahead and updated the README here to point to your tool—which is better anyway :)