public
Created

  • Download Gist
capmon.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
#!/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');
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.