Created
January 6, 2012 13:00
-
-
Save larstobi/1570505 to your computer and use it in GitHub Desktop.
Trapeze weblogin autologin
This file contains hidden or 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
| # cat /Users/larstobi/bin/weblogin | |
| #!/usr/bin/env ruby | |
| require 'rubygems' | |
| require 'mechanize' | |
| agent = Mechanize.new | |
| page = agent.get('http://webportal.login/aaa/wba_login.html') | |
| login_form = page.form('weblogin') | |
| login_form.username = 'MYUSER' | |
| login_form.key = 'MYPASSWD' | |
| agent.submit(login_form, login_form.buttons.first) | |
| # cat /Users/larstobi/Library/LaunchAgents/no.relatime.larstobi.weblogin.plist: | |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" | |
| "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>Label</key> | |
| <string>no.relatime.larstobi.weblogin</string> | |
| <key>ProgramArguments</key> | |
| <array> | |
| <string>/Users/larstobi/bin/weblogin</string> | |
| </array> | |
| <key>WatchPaths</key> | |
| <array> | |
| <string>/Library/Preferences/SystemConfiguration/</string> | |
| </array> | |
| </dict> | |
| </plist> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment