Created
April 6, 2011 04:12
-
-
Save rgrove/905116 to your computer and use it in GitHub Desktop.
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/env node | |
var zombie = require('zombie'), | |
argv = process.argv.slice(2), // get rid of the leading "node" arg | |
user = argv[0], | |
pass = argv[1]; | |
zombie.visit('https://login.comcast.net/login?continue=https%3A%2F%2Fcustomer.comcast.com%2FSecure%2FUsers.aspx', { | |
debug: true, | |
userAgent: 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6' | |
}, function (err, browser) { | |
if (err) { return error(err); } | |
browser | |
.fill('#user', user) | |
.fill('#passwd', pass) | |
.pressButton('#sign_in', function (err, browser) { | |
if (err) { return error(err); } | |
console.log(browser.text('.usage-graph-legend')); | |
}); | |
}); | |
function error(message) { | |
process.stderr.write(message.toString() + '\n'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment