New to Atom - can I call a REST API and get response?

I’m looking to call GitHub’s API and parse the results. I can run this code successfully in Coda or even in a CMS :


	// Create a new request object
	var request = new XMLHttpRequest();
	//set the callback function
	request.onload = parseResponse;

	// Initialize a request'get', '')
	// Send it

function parseResponse() {


but it doesn’t seem to work in Atom.