Skip to content

Instantly share code, notes, and snippets.

@chapel
Created October 7, 2010 05:11
Show Gist options
  • Save chapel/614586 to your computer and use it in GitHub Desktop.
Save chapel/614586 to your computer and use it in GitHub Desktop.
var httpAgent = require('http-agent'),
sys = require('sys');
var agent = httpAgent.create('http://www.bungie.net/stats/reach/playergamehistory.aspx?player=thechapel&vc=2');
agent.addListener('next', function (err, agent) {
sys.puts('Body of the current page: ' + agent.body);
sys.puts('Response we saw for this page: ' + agent.response);
// Go to the next page in the sequence
agent.next();
});
agent.addListener('stop', function (err, agent) {
sys.puts('the agent has stopped');
});
agent.start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment