/ Published in: Python
A quick and simple script to allow people to log onto the Georgia Tech wireless network without opening a browser. Pass your login details on the command line or enter them once you run the script.
Sources:
- http://www.lawn.gatech.edu/help/command_line.html
Sources:
- http://www.lawn.gatech.edu/help/command_line.html
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
import sys, getpass, urllib separator = "-----------------------------" print(separator + "\n Georgia Tech Lawn Login\n" + separator) if len(sys.argv) >= 2: username = sys.argv[0] password = sys.argv[1] if len(sys.argv) >= 3: iss = sys.argv[2] else: iss = "" else: username = raw_input("Username: ") password = getpass.getpass() iss = raw_input("Enable Inbound Security? ") if iss.strip() in ("", "true", "True", "1", "y", "Y", "yes", "Yes"): iss = "true" else: iss = "false" try: print "\nAttempting to login..." data = urllib.urlopen('https://auth.lawn.gatech.edu/index.php', 'username=' + username + '&password=' + password + '&iss=' + iss + '&output=text') print separator print data.read() except IOError, e: print "IOError:", e