From c2ddaa501ba04c229795ba230be0ab426eb2e000 Mon Sep 17 00:00:00 2001 From: Dog2puppy Date: Tue, 6 Feb 2018 17:31:41 -0500 Subject: [PATCH 1/6] Change var name --- index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index af8dd60..7030203 100644 --- a/index.js +++ b/index.js @@ -11,7 +11,7 @@ var _ = require('lodash'); */ module.exports.getCurrentStages = function() { var apiData = fetch('https://splatoon2.ink/data/schedules.json').then(res => res.json()); - var data; + var myData; apiData.then(function (json) { //league var leagueDataMode = json.league[0].rule.name; @@ -34,7 +34,7 @@ module.exports.getCurrentStages = function() { // object - data = { + myData = { apiVersion: "0.3.1", league: { lobbyMode: 'league', @@ -64,6 +64,6 @@ module.exports.getCurrentStages = function() { }); - console.log(data); - return data; -}; \ No newline at end of file + console.log(myData); + return myData; +}; From 10874a7226ddc689ca0bf8f9d39d7e85bab8412d Mon Sep 17 00:00:00 2001 From: Dog2puppy Date: Tue, 6 Feb 2018 17:39:45 -0500 Subject: [PATCH 2/6] Remove lodash and moved a line --- index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/index.js b/index.js index 7030203..d5d0ca3 100644 --- a/index.js +++ b/index.js @@ -3,7 +3,7 @@ 'use strict'; var fetch = require('node-fetch'); -var _ = require('lodash'); +var myData; /** * Gets the current battles @@ -11,7 +11,6 @@ var _ = require('lodash'); */ module.exports.getCurrentStages = function() { var apiData = fetch('https://splatoon2.ink/data/schedules.json').then(res => res.json()); - var myData; apiData.then(function (json) { //league var leagueDataMode = json.league[0].rule.name; From 495ee16fb81ed448493aeef410c588f2109756b1 Mon Sep 17 00:00:00 2001 From: Dog2puppy Date: Tue, 6 Feb 2018 18:47:28 -0500 Subject: [PATCH 3/6] Disable use strict --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index c0ca796..6d69f22 100644 --- a/index.js +++ b/index.js @@ -1,5 +1,5 @@ /*eslint-disable unknown-require */ -'use strict'; +//'use strict'; var fetch = require('node-fetch'); var myGlobal = {}; From 960da56a58c950f3765e0e660d623e47d89afb02 Mon Sep 17 00:00:00 2001 From: Dog2puppy Date: Tue, 6 Feb 2018 19:21:29 -0500 Subject: [PATCH 4/6] Use normal globals --- index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 6d69f22..53ca20a 100644 --- a/index.js +++ b/index.js @@ -31,7 +31,7 @@ module.exports.getCurrentStages = function() { var regularDataStart = json.regular[0].start_time; var regularDataEnd = json.regular[0].end_time; // object - myGlobal.splatoon2Data = { + global.splatoon2Data = { apiVersion: "0.3.1", league: { lobbyMode: 'league', @@ -59,6 +59,6 @@ module.exports.getCurrentStages = function() { } }; }); - console.log(myGlobal.splatoon2Data); - return myGlobal.splatoon2Data; + console.log(global.splatoon2Data); + return global.splatoon2Data; }; From 378168f462c9a9e01bbb5127c000a13641d24171 Mon Sep 17 00:00:00 2001 From: Dog2puppy Date: Wed, 7 Feb 2018 11:21:09 -0500 Subject: [PATCH 5/6] Update index.js --- index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 53ca20a..6f315eb 100644 --- a/index.js +++ b/index.js @@ -11,6 +11,7 @@ var myGlobal = {}; */ module.exports.getCurrentStages = function() { var apiData = fetch('https://splatoon2.ink/data/schedules.json').then(res => res.json()); + var splatoon2Data; apiData.then(function (json) { //league var leagueDataMode = json.league[0].rule.name; @@ -31,7 +32,7 @@ module.exports.getCurrentStages = function() { var regularDataStart = json.regular[0].start_time; var regularDataEnd = json.regular[0].end_time; // object - global.splatoon2Data = { + splatoon2Data = { apiVersion: "0.3.1", league: { lobbyMode: 'league', @@ -59,6 +60,6 @@ module.exports.getCurrentStages = function() { } }; }); - console.log(global.splatoon2Data); - return global.splatoon2Data; + console.log(splatoon2Data); + return splatoon2Data; }; From 7477a968af3e6e223b714cf4caa621ef79a8f278 Mon Sep 17 00:00:00 2001 From: Dog2puppy Date: Thu, 8 Feb 2018 08:17:13 -0500 Subject: [PATCH 6/6] Update index.js --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 6f315eb..ced5218 100644 --- a/index.js +++ b/index.js @@ -1,5 +1,5 @@ /*eslint-disable unknown-require */ -//'use strict'; +'use strict'; var fetch = require('node-fetch'); var myGlobal = {};