Giter Site home page Giter Site logo

ge-cancellation-checker's People

Contributors

aarongill99 avatar acrigler avatar alexpbrown avatar cbowns avatar chenbfang avatar davidofwatkins avatar ghidinelli avatar jak119 avatar josephstein avatar kilirobbs avatar mcarosino avatar nnja avatar pxt avatar quiqueg avatar ravron avatar skladany avatar yo-da-man avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ge-cancellation-checker's Issues

Can't get this to work

I'm running this on Linux Mint (base is Ubuntu 14.04 LTS) and keep getting this error. I linted my config.json and made sure the syntax was correct. I have an appointment scheduled.

$ phantomjs ge-cancellation-checker.phantom.js -v
Please wait...
On GOES login page...
Error on page: TypeError: 'null' is not an object (evaluating 'document.querySelector('input[name=username]').value = window.callPhantom('username')')
Fatal error: Unable to find terms acceptance button

Any ideas?

Log File

Log files points to current directory, change this
logfile: (optional) the full path to a logfile to be used by ge-checker-cron.py. New cancellations, unsuccessful checks, and errors are logged in this file, if provided.

to

logfile: (optional) the logfile in the current folder to be used by ge-checker-cron.py. New cancellations, unsuccessful checks, and errors are logged in this file, if provided.

Cannot find value of selected Enrollment Center

I am trying to run the command
document.querySelector('select[name=selectedEnrollmentCenter]').value

I inspect the element on the Global Entry website, but it finds no value. Where exactly do I run this command?

PhantomJS 2.1.2 + submitHome() window.location

Running Debian Stretch and getting this error:

$ phantomjs ge-cancellation-checker.phantom.js -v
Please wait...
On GOES login page...
Logging in...
Bypassing human check...
Not allowed to load local resource: file://ge-cancellation-checker.phantom.js/goes/HomePagePreAction.do

This seems related to PhantomJS failing to handle the call to submitHome(), which represents a function which calls:

function submitHome( ) {
window.location = "/goes/HomePagePreAction.do";
}

The call to window.location seems to fail, on my build, with PhantomJS 2.1.2, with the error, above.

The solution, for me: edit file ge-cancellation-checker.phantom.js, commenting out submitHome() and manually calling window.location to the full URL:

98 function() { // Accept terms
99 page.evaluate(function() {
100
101 //submitHome();
102 window.location = "https://goes-app.cbp.dhs.gov/goes/HomePagePre Action.do";
103
104 console.log('Bypassing human check...');
105 });
106 },

Hope this helps someone else!

Unable to find Manage Appointment button

Hi all. I'm trying to use the script for my friend, which was working couple months ago for me. I got the following error,

Please wait...
On GOES login page...
Error on page: TypeError: null is not an object (evaluating 'document.querySelector('form[action=j_security_check]').submit')

  phantomjs://code/ge-cancellation-checker.phantom.js:55 in onError
Error on page: ReferenceError: Can't find variable: submitHome

  phantomjs://code/ge-cancellation-checker.phantom.js:55 in onError
Fatal error: Unable to find Manage Appointment button

I can get around the Can't find variable: submitHome by manually calling window.location to the full URL, props to @iokevins shared in #20. However, .bluebutton[name=manageAptm] does not seem to respond. Any ideas?

Also they have updated the location selection page from drop down menu. Not sure if it's going to affect the script. Cannot get it tested at the moment.

Multiple TypeError issues

Just getting this setup, and I'm getting a few TypeError issues...

Please wait...
On GOES login page...
Logging in...
Bypassing human check...
Error on page: TypeError: undefined is not an object (evaluating 'document.document.ApplicationActionForm')

  phantomjs://code/ge-cancellation-checker.phantom.js:54 in onError
Entering appointment management...
Entering rescheduling selection page...
Choosing Location: Washington Dulles International Global Entry EC - 22685 International Arrivals- Main Terminal, Washington Dulles International Airport, Sterling , VA 20041, US
Error on page: TypeError: null is not an object (evaluating 'document.querySelector('.date table tr:first-child td:first-child').innerHTML')

  phantomjs://code/ge-cancellation-checker.phantom.js:54 in onError

GOES site redesign

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?

Erron on page: TypeError: undefined is not an object (evaluating 'document.document.ApplicationActionForm')

When I run the script, I get the following errors:

C:\Python27\Scripts\ge>phantomjs ge-cancellation-checker.phantom.js -v
Please wait...
On GOES login page...
Logging in...
Bypassing human check...
Error on page: TypeError: undefined is not an object (evaluating 'document.docum
ent.ApplicationActionForm')

  phantomjs://code/ge-cancellation-checker.phantom.js:54 in onError
Entering appointment management...
Entering rescheduling selection page...
Choosing Location: Champlain Enrollment Center - 237 West Service Road, Champlai
n , NY 12919, US
Error on page: TypeError: null is not an object (evaluating 'document.querySelec
tor('.date table tr:first-child td:first-child').innerHTML')

  phantomjs://code/ge-cancellation-checker.phantom.js:54 in onError

config.json.example is invalid JSON

The example configuration file contains invalid JSON. Specifically the comma on the last line (init_url) should not be there:

$ jsonlint config.json.example
Error: Parse error on line 11:
...dhs.gov/main/goes",}
----------------------^
Expecting 'STRING', got '}'
    at Object.parseError (/usr/local/lib/node_modules/jsonlint/lib/jsonlint.js:55:11)
    at Object.parse (/usr/local/lib/node_modules/jsonlint/lib/jsonlint.js:132:22)
    at parse (/usr/local/lib/node_modules/jsonlint/lib/cli.js:82:14)
    at main (/usr/local/lib/node_modules/jsonlint/lib/cli.js:135:14)
    at Object.<anonymous> (/usr/local/lib/node_modules/jsonlint/lib/cli.js:179:1)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)

GOES site changed from ENTER to Check Here If Human Tick Box

Was working perfect, GOES changed the website today.

2016-08-01 19:20:51,944 Couldn't convert output: Fatal error: Unable to find terms acceptance button from phantomJS script into a valid date.
Traceback (most recent call last):
File "/home/mick/globalentry/5446_SFO/ge-checker-cron.py", line 70, in main
new_apt = datetime.strptime(script_output, '%B %d, %Y')
File "/usr/lib/python2.7/_strptime.py", line 332, in _strptime
(data_string, format))
ValueError: time data 'Fatal error: Unable to find terms acceptance button' does not match format '%B %d, %Y'
2016-08-01 19:24:34,026 Running GE cron with arguments: {'no_email': False, 'configfile': '/home/mick/globalentry/5446_SFO/config.json', 'notify_osx': False, 'use_gmail': True}
2016-08-01 19:24:38,024 Couldn't convert output: Fatal error: Unable to find terms acceptance button from phantomJS script into a valid date.
Traceback (most recent call last):
File "/home/mick/globalentry/5446_SFO/ge-checker-cron.py", line 70, in main
new_apt = datetime.strptime(script_output, '%B %d, %Y')
File "/usr/lib/python2.7/_strptime.py", line 332, in _strptime
(data_string, format))

Does not work with Twilio 6.x.x

When installing Twilio (pip install twilio), as of today, the Twilio version is 6.0.0, which uses a slightly different import and initialization. As detailed in Twilio's migration guide, the following changes are required in ge-checker-cron.py

  1. from twilio.rest import TwilioRestClient needs to change to from twilio.rest import Client
  2. client = TwilioRestClient(account_sid, auth_token) needs to change to client = Client(account_sid, auth_token)

possible to choose alternate location AND specify exact date?

I am currently booked at Boston Logan Airport "5441" for July 26 and would like to be notified of availability at either Boston Logan Airport "5441" or the Boston Federal Building "14221" on Tuesday, June 13. I am not programmer savvy, unfortunately. Any thoughts or ideas on how I can achieve this? Thanks!

Issue with centers with intermediate step

For some centers that are close together (BWI & IAD for example) there is an additional page that you are directed to after selecting the center. This breaks the flow in phantom. The page you are redirected to is https://goes-app.cbp.dhs.gov/main/goes/SelectEnrollmentCenterPostAction.do, which gives you an option to select another close by center.

Steps to reproduce:

  1. Set 7940 as the enrollment center (BWI)
  2. Run phantomjs ge-cancellation-checker.phantom.js -v
  3. Observe error

phantomjs ge-cancellation-checker.phantom.js -v
Please wait...
On GOES login page...
Logging in...
Accepting terms...
Entering appointment management...
Entering rescheduling selection page...
Choosing Location: Baltimore Enrollment Center - Baltimore Washington Thurgood Marshall I, Lower Level Door 18, Linthicum, MD 21240, US
Error on page: TypeError: null is not an object (evaluating 'document.querySelector('.date table tr:first-child td:first-child').innerHTML')

config file cannot be found (using Docker to run the scripts)

Hi all,

I ran the code according to the Docker instructions but the script cannot find the config.json file even though it's in the main directory.

$> ls -la
total 56
drwxrwxrwx 3 nobody nogroup 4096 Feb  8 11:08 .
drwxrwxrwx 9 nobody nogroup 4096 Feb  8 10:57 ..
-rwxrwxrwx 1 nobody nogroup  714 Feb  8 11:08 config.json
-rwxrwxrwx 1 nobody nogroup  586 Feb  8 10:57 config.json.example
-rwxrwxrwx 1 nobody nogroup 1150 Feb  8 10:57 CONTRIBUTING.md
-rwxrwxrwx 1 nobody nogroup 1037 Feb  8 10:57 Dockerfile
-rwxrwxrwx 1 nobody nogroup 6914 Feb  8 10:57 ge-cancellation-checker.phantom.js
-rwxrwxrwx 1 nobody nogroup 7743 Feb  8 10:57 ge-checker-cron.py
drwxrwxrwx 8 nobody nogroup 4096 Feb  8 10:57 .git
-rwxrwxrwx 1 nobody nogroup   18 Feb  8 10:57 .gitignore
-rwxrwxrwx 1 nobody nogroup 6736 Feb  8 10:57 README.md
$> docker build -t ge-cancellation-checker .
Sending build context to Docker daemon   127 kB
Step 1/7 : FROM ubuntu:12.04
 ---> f0d07a756afd
Step 2/7 : ENV PHANTOMJS_VERSION 1.9.7
 ---> Using cache
 ---> bcc03145c179
Step 3/7 : RUN apt-get update &&   apt-get upgrade -y &&   apt-get install -y vim git wget libfreetype6 libfontconfig bzip2 &&   mkdir -p /srv/var &&   wget -q --no-check-certificate -O /tmp/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 &&   tar -xjf /tmp/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 -C /tmp &&   rm -f /tmp/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 &&   mv /tmp/phantomjs-$PHANTOMJS_VERSION-linux-x86_64/ /srv/var/phantomjs &&   ln -s /srv/var/phantomjs/bin/phantomjs /usr/bin/phantomjs &&   git clone https://github.com/n1k0/casperjs.git /srv/var/casperjs &&   ln -s /srv/var/casperjs/bin/casperjs /usr/bin/casperjs &&   apt-get autoremove -y &&   apt-get clean all
 ---> Using cache
 ---> 2b1f28beb2a8
Step 4/7 : ADD . /opt/ge_checker
 ---> Using cache
 ---> d424237315f4
Step 5/7 : VOLUME /logs
 ---> Using cache
 ---> 70fdb5f38cc5
Step 6/7 : WORKDIR /opt/ge_checker
 ---> Using cache
 ---> 2a0f60430828
Step 7/7 : CMD /usr/bin/phantomjs --ssl-protocol=any ge-cancellation-checker.phantom.js -v
 ---> Using cache
 ---> 186f5a6ccb72
Successfully built 186f5a6ccb72
$> docker run ge-cancellation-checker
Could not find ./config.json
$>

Still a bit new to Docker... do I have to set up a special mount point for the docker container to find the config file?

Thanks for any advice!

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.