Last active
December 22, 2015 02:18
-
-
Save artursapek/6402093 to your computer and use it in GitHub Desktop.
Checks in for your Southwest flight. Schedule this for a little bit before your 24-hour time and it will run until it succeeds, and get you an early boarding number and therefore a good seat.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# POSTs your confirmation key, first name, and last name | |
# to Southwest.com check-in endpoint over and over | |
# until it doesn't see the 24-hour error. | |
# In testing I never got rate-limited or blocked | |
# but I didn't let it run for very long at a time | |
# so use at your own risk. :) | |
# Six-character SW confirmation token here | |
CONF=AB1234 | |
ENDPOINT=http://www.southwest.com/flight/retrieveCheckinDoc.html | |
# Just in case they block more aggressively based on UA (I doubt it) | |
UA="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.62 Safari/537.36" | |
check_output() { | |
while read stdin; | |
do | |
match=$(echo $stdin | grep "more than 24 hours prior"); | |
if [[ $match != "" ]]; then | |
echo "Failed to check-in for $2... trying again" | |
run $@; | |
return 0; | |
fi | |
done; | |
echo "Successfully checked in on behalf of $2" | |
} | |
run() { | |
curl --user-agent $UA --data "confirmationNumber=$1&firstName=$2&lastName=$3" $ENDPOINT | check_output $@; | |
} | |
run $CONF Artur Sapek |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment