Open drocus opened 6 years ago
just saw this too... damn...
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.
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?
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.
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
Well, there are a few issues. DHS added support for:
2factor auth (pin via email/text)
CAPTCHA during the login
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.
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?
@Darkside- well i'll be damned... good find!
@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.
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).
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.
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.
Awesome! Nice job @Drewster727
Excellently done, @Drewster727! I've gone ahead and updated the README here to point to your tool—which is better anyway :)
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?