var casper = require('casper').create(); 
var gamertags = ['mike yaworski', 'CasperJS', 'PhantomJS']; // array of gamertags to check 
var j = 0; 
  
casper.start(); 
  
console.log("\nXbox Gamertags:\n"); 
  
for (i = 0; i < users.length; i++) 
{ 
    casper.thenOpen("https://live.xbox.com/en-US/Profile?gamertag=" + gamertags[i].replace(" ", "%20"), function() { 
          
        j++; 
        var message = ""
          
        if (this.getTitle() === ("Page Not found - Xbox.com")) { 
            message = gamertags[j-1] + ":  AVAILABLE\n"; 
        } else { 
            message = gamertags[j-1] + ": NOT AVAILABLE\n"; 
        } 
          
        this.echo(message); 
    }); 
} 
  
casper.run();
DOWNLOAD

             Created: January 22, 2014
Completed in full by: Michael Yaworski