Read the statement by Michael Teeuw here.
Stocks
-
@ZTA0796 The object that you get int the stocks.js is the deserialized javascript object. In your case it’s going to be a single row object. You could just access the properties list this:
this.result.symbol, this.result.price, etc…
-Alex
-
@alexyak So that’s what I expected as well. Unfortunately, it is somehow getting messed up between the “socketNotificationReceived” function and the “getDom” function.
socketNotificationReceived: function(notification, payload) { if (notification === "STOCKS_RESULT") { this.result = payload; console.log(this.result); //prints my JSON correctly console this.updateDom(self.config.fadeSpeed); }
So the above works correctly. Below, however, it doesn’t seem to maintain and I can’t figure out why.
getDom: function() { var wrapper = document.createElement("table"); wrapper.className = 'normal regular small'; var count = 0; var _this = this; console.log("result is " + this.result); //prints "result is [object Object]" console.log("result length is " + this.result.length); //prints "result length is 0" console.log(this.symbol); //prints "undefined" }
I apologize if I’m being thick, but I can’t figure out why it’s not working…
-
Ok, so I think i figured it out. Still not sure why it worked, but for some reason, running a console.log("descriptive text " + this) seems to corrupt or change the type of “this”. If I put two consecutive console.log() calls–first with descriptive text, second with just “this”–then it works. Basically in the example above, if I just comment out the first two console.log() calls, then it no longer prints “undefined” and instead prints “MSFT”. Sorry for all the trouble!
-
Several weeks ago this module seemed to stop working. It doesn’t generate any errors, just won’t display. Has anyone else seen this?
Thanks, Dave
-
@Mitch1138 Yes same for me, this module no longer works.
-
@Mitch1138 said in Stocks: > Has anyone else seen this?
@pugsly > Yes same for me, this module no longer works.
At first glance, putting the url into a browser results in a 404 error
http://finance.google.com/finance/info?client=ig&q=.DJI,MSFT,AAPL,GOOG,INTC,CICS,TSLA,FB -
The url in the module no longer works… it won’t give an error it’s a 404 error…
I’m seeing if I can find a url replacement…
-
@alexyak
can’t seem to get this updating on the MM display, any ideas? Was there any change to the original code? -
@cowboysdude
Did you find a working URL replacement?
Have you been using another Stocks module instead? -
@homebrew No sorry I haven’t. I don’t use stock modules :) I don’t do stocks LOL
BUT if you can find a url that works I can look at the module for you…