I use the alt dashboard and noticed today that the time for the max wind gust for today contains an underscore (“_”).
Right now my page shows:
Max Gust: 10.0@ 8:27_AM
I went looking for a solution and can’t find one.
The max gust time comes from the clientraw file and is pulled by the custom ajaxWDwx.js script used by the alt dashboard as follows:
maxgusttime = clientraw[135]; // Max wind gust time
I do not see any further processing of maxgusttime.
I then went to the clientraw parsers at tnetweather.com to see what it showed for maxgusttime and it shows:
135 Max Gust Today Time L 8:27 AM
So the underscore is not in the clientraw file.
Looking at http://www.websterweatherlive.com/ (the alt dashboard home site), sure enough it has the underscore also, so it is not something I have inadvertently added into my alt dashboard.
As I have said in earlier posts, i really like using subdirectories and my wd directory only has 5 files in it: 3 index files (redirection to the actual index), favicon.ico and a 404.jpg file.
If you look at the file there’s an inconsistency in the time formats, 134 Max Gust Last Hour Time has no space/underscore between the time and AM/PM but 135 Max Gust Today Time does.
You guys peaked my curiosity.
Is it possible to convert the clientraw text files to a CSV using a client side javaScript for use in an array? I did not think it could be done unless using something like php on the server as it seems Bill is using.
Why do you need to convert it to a .csv to put it into an array? Looks like the dashboard script puts it into an array using the space delimiter (“clientraw[135]” is an array element).
Ah ha!
Yes, I understand Ajax does that sort of thing, but unless I misread the chapter on Ajax it does require server side software, and hence my ‘odd ball’ question. There are two challenges I am finding with JavaScript when using it client side that I can’t seem to find away around with clientraw files. One can’t import the clientraw file, and second javascript client side does not seem to support space delimiters in an array.
Sometime in the future, if we ever get RELIABLE highspeed Internet in our rural part of Ontario, I will make the switch to a web host that will support server side software, but for now my little script files sort of fit my needs. But darn, I sure wish I could use those clientraw files now.
Hmmmm, I see the problem, I think throwing a few loonies at it is the only way to resolve that one. e-rice.net + a domain name from godaddy is pretty cheap, $20/year or so.
I finally found the place to insert this line to replace the “_” located in the ajaxWDwx.js file in this area, couldn’t locate until I found some time to dig around:
//clientraw[140] = 20.2;
;;;set_ajax_obs(‘ajaxProgress’,rand+‘wspd’,‘in WindSpeed’);
wind = parseFloat(clientraw[ 2]).convertWind(); // Wind gust
gust = parseFloat(clientraw[140]).convertWind(); // Max wind gust in last
minute
windmaxavg = parseFloat(clientraw[113]).convertWind(); // Max avg speed
maxgust = parseFloat(clientraw[ 71]).convertWind(); // Max wind gust maxgusttime = clientraw[135].replace(“_”, " "); // Max wind gust time
beaufortnum = ajax_getBeaufortNumber(clientraw[2]);