From 62c089fbf00d759898068187d3357b4f0b40ba07 Mon Sep 17 00:00:00 2001 From: Robert Grimes Date: Sun, 4 Feb 2018 17:46:14 -0600 Subject: [PATCH 1/3] Modified deps to use a fixed version of the yahoo-stocks module. --- modules/quote.js | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/quote.js b/modules/quote.js index 30be943..10957da 100644 --- a/modules/quote.js +++ b/modules/quote.js @@ -8,7 +8,7 @@ function quote(bot, _words, from, to) { YahooStocks.lookup(_words[1]).then(function(res){ let curr = res; - YahooStocks.history(_words[1]).then(function(res){ + YahooStocks.history(_words[1],{range:'5d'}).then(function(res){ let old = res.previousClose; let change = curr.currentPrice - old; let percentage = ( change / curr.currentPrice ) * 100; diff --git a/package.json b/package.json index 9d27f11..953ac04 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,6 @@ "pg": "^6.2.4", "request": "latest", "winston": "latest", - "yahoo-stocks": "^2.0.1" + "yahoo-stocks": "rmzg/yahoo-stocks" } } From 573b8a880ac81f0ffcdae3783223d7c8d43a2617 Mon Sep 17 00:00:00 2001 From: Robert Grimes Date: Mon, 24 Dec 2018 15:07:51 -0600 Subject: [PATCH 2/3] My changes --- config.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config.js b/config.js index 53d3562..ebf3888 100644 --- a/config.js +++ b/config.js @@ -1,7 +1,7 @@ module.exports = { - channels: ["#elitistjerks"], - server: "NuclearFallout.WA.US.GameSurge.net", - botName: "rememe", + channels: ["#elitistjerks","#buubot"], + server: "irc.gamesurge.net", + botName: "memer", urlSummarizer: { yieldToOtherBots: true, otherBots: ["meme"], From 2765c816e295eb7b18c952eb031d1d79c05a02ee Mon Sep 17 00:00:00 2001 From: Robert Grimes Date: Wed, 27 Jan 2021 16:29:14 -0600 Subject: [PATCH 3/3] Fixed stock changed percentage --- modules/quote.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/quote.js b/modules/quote.js index 39d4da0..f00d3cf 100644 --- a/modules/quote.js +++ b/modules/quote.js @@ -12,7 +12,7 @@ function quote(bot, _words, from, to) { YahooStocks.history(_words[1]).then(function (res) { let old = res.records[res.records.length - 1].open; let change = curr.currentPrice - old; - let percentage = (change / curr.currentPrice) * 100; + let percentage = (change / old) * 100; percentage = Math.round(percentage * 100) / 100; change = Math.round(change * 100) / 100;