Georgia Tech LAWN login script


/ Published in: Python
Save to your folder(s)

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


Copy this code and paste it in your HTML
  1. import sys, getpass, urllib
  2.  
  3. separator = "-----------------------------"
  4. print(separator +
  5. "\n Georgia Tech Lawn Login\n" +
  6. separator)
  7.  
  8. if len(sys.argv) >= 2:
  9. username = sys.argv[0]
  10. password = sys.argv[1]
  11. if len(sys.argv) >= 3:
  12. iss = sys.argv[2]
  13. else:
  14. iss = ""
  15. else:
  16. username = raw_input("Username: ")
  17. password = getpass.getpass()
  18. iss = raw_input("Enable Inbound Security? ")
  19.  
  20. if iss.strip() in ("", "true", "True", "1", "y", "Y", "yes", "Yes"):
  21. iss = "true"
  22. else:
  23. iss = "false"
  24.  
  25. try:
  26. print "\nAttempting to login..."
  27. data = urllib.urlopen('https://auth.lawn.gatech.edu/index.php',
  28. 'username=' + username +
  29. '&password=' + password +
  30. '&iss=' + iss +
  31. '&output=text')
  32. print separator
  33. print data.read()
  34. except IOError, e:
  35. print "IOError:", e

URL: http://andrewtrusty.com/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.