Showing posts with label JavaScript. Show all posts
Showing posts with label JavaScript. Show all posts

Friday, June 7, 2013

Southwest Flight Auto Check-In

I've taken a few flights on Southwest over the last couple of months and have another coming up.
One thing I don't particularly enjoy is the day-before-flight ritual of watching the clock, waiting to click the check-in button so I can get a decent seat.  The early bird option at $12.95 each way doesn't seem like a great value, and besides, I'm too cheap anyway.

Not long ago there was a great website that allowed users to enter Southwest flight info and would automatically check them in for their flight. Southwest, not surprising, put an end to that. :(  With the success of my Pandora user script, I thought another go was in order.

Last night I spent about an hour putting this little user script together that *should* work. I tested all the way up to the actual printing your boarding pass page.  I saved a copy of all the check-in pages the last time I flew Southwest in anticipation of someday writing a script like this.  From those saved pages, I think I'm doing everything correctly.  Have to wait until my actual flight to find out - wish me luck.

The magic happens after you input your flight information and click the 'Check In' button.  The script keys off the oops message Southwest provides and inserts inputs for the date/time of your flight.  Make sure the oops is because you're over the 24-hour period and not for some other reason.

Date/Time Input

Wednesday, March 13, 2013

Yes, Pandora, I'm Still Listening

Lately I've been listening to Pandora as background noise while coding.  Like you, I've clicked the "I'm still listening" button more times than I'd care too.  Today I decided to do something about it; I'm not talking about paying to upgrade Pandora either.

I'm sure someone out there has already written a perfectly good Greasemonkey script that I could use, but where is the fun in that.  It has been a while since I wrote anything in JavaScript so I figured this would be a great opportunity to clear away any cobwebs.

The first thing that needs to happen is to be notified of any changes to the DOM.  This is quite easy using MutationObserver defined in the DOM4 specification.  The callback is provided with a MutationRecord that contains the addedNodes as a property.  We can then search the addedNodes for the "I'm still listening" button.