Created
November 25, 2011 17:18
-
-
Save sobelk/1394006 to your computer and use it in GitHub Desktop.
TD Bank check balance shell script
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
#!/usr/bin/sh | |
DOMAIN="onlinebanking.tdbank.com" | |
COOKIEJAR="cookiejar-tdbank" | |
USERAGENT='Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.121 Safari/535.2' | |
USERNAME="username" | |
read -sp "Password: " PASSWORD; echo | |
curl \ | |
--silent \ | |
--user-agent "$USERAGENT" \ | |
--cookie-jar $COOKIEJAR \ | |
--cookie $COOKIEJAR \ | |
--data-urlencode "user=$USERNAME" \ | |
--data-urlencode "pin=$PASSWORD" \ | |
"https://$DOMAIN/voyLogin.asp" > /dev/null | |
curl \ | |
--silent \ | |
--user-agent "$USERAGENT" \ | |
--cookie-jar $COOKIEJAR \ | |
--cookie $COOKIEJAR \ | |
--data-urlencode "user=$USERNAME" \ | |
--data-urlencode "pin=$PASSWORD" \ | |
"https://$DOMAIN/accts/getAccts.asp?fname=SCRIPT" \ | |
| egrep '\$[0-9,.]+' \ | |
| sed 's/.*$\([0-9,.]*\).*/\1/' \ | |
| head -n1 | |
rm $COOKIEJAR |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment