davidofwatkins / ge-cancellation-checker

A PhantomJS script that checks your GOES account for a sooner Global Entry enrollment appointment

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Additions in forks

paulirish opened this issue · comments

I'm about to set this up.. and just noticed some nice work in various forks.. just FYI for you

thanks for the project!

Awesome! Wow, thanks for bringing these to my attention, @paulirish! I'll get these great changes merged in when I can :)

And as always, feel free to open a PR if you're making changes of your own!

And then over in my fork I made a few changes (some that break the cron & email flow)

  • can check multiple locations
  • better error reporting
  • mapping location IDs to readable names

image

downside is the python doesn't yet handle the multi-location results from the phantom script

but other than that it's feeling p good

I've made extensive changes in my fork as well.

I haven't documented them yet, but in summary:

  • Fully refactored the python code to make it easier to understand and more extensible
  • Added support for flags, added the following flags:
    1. config for sending through a gmail account, so you don't have to set up sendmail locally
    2. no mail flag
    3. osx specific: notify via the notification center when a new appointment is found
  • Since cron isn't well supported on osx, I added a plist file for an osx launch daemon which is currently configured to run every 30 minutes. Instructions for setting up the daemon are currently in a comment at the top of the file.

@paulirish When I have time next week, I can pull in your latest changes on the phantomjs side and make updates to the python script to support multiple locations.

@davidofwatkins The pull request #3 I opened 2 weeks ago with small bug fixes hasn't been acknowledged, so if you're interested in merging any of these changes feel free to reach out to me.

@nnja Thanks for submitting the PR! Apologies for not responding yet; I've been swamped with other work recently, but I'll try to take a look as soon as I can! :)

@davidofwatkins - Would you like me to open a PR with the bigger changeset including the features I mention above? The additions I made are backwards compatible with your branch.

@nnja you're a champion! thanks for sorting this out. :)

@nnja Awesome, yes that would be great. All sound like good improvements.

@nnja did you ever get that plist stuff done? I don't see anything about that in the files...

@pixitha Yes, along with some refactoring so I had an easier time working on the code - but there were conflicts before I had an opportunity to open a PR and I don't have time to work on this anymore.

If you want to take a look, my branch is here: https://github.com/nnja/ge-cancellation-checker

I added some additional flags:

parser.add_argument('--no-email', action='store_true', dest='no_email', default=False, help='Don\'t send an e-mail when the script runs.')
parser.add_argument('--use-gmail', action='store_true', dest='use_gmail', default=False, help='Use the gmail SMTP server instead of sendmail.')
parser.add_argument('--notify-osx', action='store_true', dest='notify_osx', default=False, help='If better date is found, notify on the osx desktop.')

The plist is here with instructions for how to run it as a comment at the top of the file.

Unfortunately I never did update the README, so it's a big ad-hoc.

Hope that helps!

@pixitha I'm mistaken and the changes with the flags were merged in, just not the plist.

I'll submit a proper PR for the plist when I have time, as well as updates to the README with instructions.

In the meantime, this should be enough to get you started.

Dumb question about the plist, having issues getting it to work correctly.

When I load the plist, it runs the python script just fine, but then python appears to have issues locating phantomjs, even though I can run everything by hand just fine?

09/28/2016 09:32:05 PM Running GE cron with arguments: {'no_email': False, 'configfile': '/Users/xxxxx/ge-cancellation-checker/config.json', 'notify_osx': True, 'use_gmail': False}
09/28/2016 09:32:05 PM Something went wrong when trying to run ge-cancellation-checker.phantom.js. Is phantomjs is installed?