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; // 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.
Does someone have a suggestion for a fix?
I couldn’t find your clientraw, but webster weather’s clientraw does have an underscore “5:35_AM”, I think the tnet parser is ignoring it.
Thanks Niko, I have now looked at my clientraw.txt file and see that it does have the underscore. (Sometimes eyeballs work better than computers!).
So, the question becomes–Why have an underscore in the times? I assume the clientraw is parsed using spaces as the delimiter and that is the reason.
Oh, my clientraw.txt file and really all of the WD data is at
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.
Easy fix in php but I can’t help with .js
maxgusttime = clientraw.replace("_", "");
I just tested and it works fine on my site:
Good deal. So much helpful information on the internet these days
You guys peaked my curiosity.
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” is an array element).
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.
Thanks niko. That underscore always bugged me.
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 = 20.2;
wind = parseFloat(clientraw[ 2]).convertWind(); // Wind gust
gust = parseFloat(clientraw).convertWind(); // Max wind gust in last
windmaxavg = parseFloat(clientraw).convertWind(); // Max avg speed
maxgust = parseFloat(clientraw[ 71]).convertWind(); // Max wind gust
maxgusttime = clientraw.replace(“_”, " "); // Max wind gust time
beaufortnum = ajax_getBeaufortNumber(clientraw);
// Wind gust
if (maxgust > 0.0 )
set_ajax_obs(“ajaxmaxgust” , maxgust.toFixed(dp.Wind) +’ '+ uom.langWind);
else set_ajax_obs(“ajaxmaxgust” , ‘Calm’);
// Max wind gust
set_ajax_obs(“ajaxwindmaxgust” , maxgust.toFixed(dp.Wind) +’ '+ uom.langWind);
// Max wind gust No UofM
set_ajax_obs(“ajaxwindmaxgust2” , maxgust.toFixed(dp.Wind));
I put a space in mine to separate the time and am/pm.
Thank you niko for the fix.
Hmmm, I think it’s a modification of a line that already exists, not something to be inserted :?
Yes, it is a modification of that line that already exists by editing “replace(”_", " “)” without the outside quotes within that line.
Thanks again for your insight.