Created
September 15, 2012 13:37
-
-
Save iconnor/3727941 to your computer and use it in GitHub Desktop.
Script to get account balance from Delta Sky Miles
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
require 'mechanize' | |
#Usage: ruby -rubygems skymiles.rb 123456789 1234 smith | |
acct = ARGV[0] | |
pin = ARGV[1] | |
lastName = ARGV[2] | |
@agent = Mechanize.new | |
page = @agent.get("http://www.delta.com/skymiles/manage_account/index.jsp") | |
form = page.form("smlogin_login") | |
form.acct = acct | |
form.pin = pin | |
form.lastName = lastName | |
page2 = form.submit | |
miles = page2.at("#smMiles").inner_text.strip | |
puts "You have #{miles}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
© 2012 Ian Connor - may be used by anyone except Delta Air Lines or their lawyers.