Last active
August 29, 2015 14:13
-
-
Save ikarino/3f622287a1e23fe84150 to your computer and use it in GitHub Desktop.
login nico applescript
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
on loginFromSafari(username, password) | |
set loginURL to "https://secure.nicovideo.jp/secure/login_form" | |
tell application "Safari" | |
activate | |
make new document with properties {URL:loginURL} | |
delay 1 | |
do JavaScript "document.getElementsByName('mail_tel')[0].value = '" & username & "';" in document 1 | |
do JavaScript "document.getElementsByName('password')[0].value = '" & password & "';" in document 1 | |
do JavaScript "document.getElementsByClassName('login_button')[0].children[0].click();" in document 1 | |
close document 1 | |
end tell | |
end loginFromSafari |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment