var http = require('http')
,	file = require('fs')
,	NHLScore = require('./my_modules/nhl.js')
,	NFLScore = require('./my_modules/nfl.js');

//var league = Object.create(NHLScore);
var league = Object.create(NHLScore);

var getData = function() {
	var rawResponse = '';
	var request = http.get(league.updateURL, function(res) {
		res.on('data', function(chunk) {
			//console.log('Got %d bytes of data', chunk.length);
			rawResponse += chunk;
		});
		res.on('end', function() {
			var array = league.getGameArray(rawResponse);
			//toFile(array);
			console.log('Response: ' + JSON.stringify(array,null,2));
		});
	}).on('error', function(e) {
		console.log('Error: ' + e.message);
	});

	var toFile = function(data){
		var s = JSON.stringify(data,null,2);
		var d = new Date(); 
		var dateString = d.getMonth().toString() + 
			d.getDate().toString() + 
			d.getFullYear().toString() + 
			d.getHours().toString() + 
			d.getMinutes().toString();
		var fileName = './tests/' + league.league + '-automated/' + 
			league.league + '-' + dateString + '.json';
		file.writeFile(fileName, s, function(err) {
			if(err) {
				console.log(err);
			} else {
				console.log(fileName + ' save successfully.');
			}
		});
	};
};

var loop = setInterval(getData, 300000);
console.log('Created loop');
getData();
@@ -779,20 +779,21 @@
  %0A%09%09var 
-date
+month
 String =
@@ -797,123 +797,346 @@
 g = 
-d.getMonth().toString() + %0A%09%09%09d.getDate().toString() + %0A%09%09%09d.getFullYear().toString() + %0A%09%09%09d.getHours().toString()
+(d.getMonth() %3C 10 ? '0' : '') + d.getMonth().toString();%0A%09%09var dayString = (d.getDate() %3C 10 ? '0' : '') + d.getDate().toString();%0A%09%09var hourString = (d.getHours() %3C 10 ? '0' : '') + d.getHours().toString();%0A%09%09var minuteString = (d.getMinutes() %3C 10 ? '0' : '') + d.getMinutes().toString();%0A%09%09var dateString = monthString + %0A%09%09%09dayString
  + %0A
@@ -1139,31 +1139,32 @@
  + %0A%09%09%09d.get
-Minutes
+FullYear
 ().toString(
@@ -1156,32 +1156,68 @@
 ear().toString()
+ + %0A%09%09%09hourString + %0A%09%09%09minuteString
 ;%0A%09%09var fileName

fix filename in tests