FlyerTalk Forums - View Single Post - Does CO use sweeps for SWUs?
View Single Post
Old Dec 19, 2011 | 5:15 pm
  #14  
mherdeg
All eyes on you!
15 Years on Site
 
Join Date: Jan 2009
Location: LHR (sometimes CLE, SFO, BOS, LAX, SEA)
Programs: Dunkin' Rewards Boosted
Posts: 5,915
Originally Posted by mahasamatman
Time to write a script to check inventory at 10-minute intervals...
FYI this is really easy.

For scripting continental.com, I recommend WWW::Mechanize, which also available for Python speakers at http://wwwsearch.sourceforge.net/mechanize/ and for Ruby at http://mechanize.rubyforge.org/.

Every CO page is one big form, and there are multiple submit buttons that cause the page to do different things -- so be careful about supplying the right parameter to submit().

I'm lazy, so I parse the output with BeautifulSoup, then shove the relevant parts into a well-formed XML tree I generate with lxml, which I can serve up via the Web or on a phone app with zero friction.

I run an every-10-minutes cronjob which checks availability and e-mails my phone's SMS address whenever there's a change. If you just tweak a line with grep, you get "e-mail when R space changes" instead. I've been meaning to do this intelligently with a proper phone app, push notifications, etc. but the overhead is hardly worth it.
mherdeg is offline