Giter Club home page Giter Club logo

swa-checkin's Introduction

SWA CheckIn

Automate the Southwest Airlines Check-In process!

Uses a headless chrome browser and optionally emails you a screenshot of the result (hopefully a successful check-in)

Debian/Ubuntu Installation

Ruby

Install ruby (2.5.1) using your preferred installer/manager. (I heavily recommend RVM)

Then run

gem install bundler
bundle install

Chrome

Install latest Google Chrome

# Install latest Google Chrome
sudo apt-get install libxss1 libappindicator1 libindicator7
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb

sudo dpkg -i google-chrome*.deb
sudo apt-get install -f

# Install xvfb so we can run Chrome headlessly
sudo apt-get install xvfb

# Cleanup
rm google-chrome-stable_current_amd64.deb

Chromedriver

chromedriver is used to drive the headless browser.

chromedriver versions are very specifically tied to Google Chrome versions. To determine the correct chromedriver version to install:

  1. Check your version of Google Chrome with google-chrome-stable --version
  2. Scan this unorganized list of chromedriver versions. Find the closest possible version to the Google Chrome version without exceeding it.
sudo apt-get install unzip

# Install `chromedriver`. Insert the version determined above
wget -N http://chromedriver.storage.googleapis.com/72.0.3626.7/chromedriver_linux64.zip

# Extract and make it executable
unzip chromedriver_linux64.zip
chmod +x chromedriver

# Make it available in various PATH locations
sudo mv -f chromedriver /usr/local/share/chromedriver
sudo ln -s /usr/local/share/chromedriver /usr/local/bin/chromedriver
sudo ln -s /usr/local/share/chromedriver /usr/bin/chromedriver

# Cleanup
rm chromedriver_linux64.zip

Environment

The script relies on several Environment variables to exist. To make defining these easier, you can fill out the provided sample environment config file.

cp .env.sample .env

# Open up `.env` and follow the instructions
vi .env

Run

To run the script:

./swa.rb

For a full list of options:

./swa.rb --help

Schedule

Of course, you'll probably want to schedule the script so you can have it run at a specific time and check in for you.

If you're using cron you can easily schedule it as follows.

# Be sure to replace `someuser`, the `/path/to/*`, and the cron timing.
00 00 00 00 * (env && /path/to/ruby /path/to/swa.rb) > /home/someuser/cron.log 2>&1

Notes:

  • cron loads with no knowledge about your environment. See this post on how to run ruby scripts in cron sessions. It was written with rvm in mind but can be adapted to rbenv and other tools
  • The above crontab entry prints out the env and logs everything to a logfile as a useful debugging tool
  • In general, you may find it useful to enable system wide cron logging as well.

swa-checkin's People

Contributors

abhchand avatar

Watchers

James Cloos avatar

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.