Page 3 of 4
Re: New addon: Live data on the web
Posted: Mon 12 Apr 2010 6:09 pm
by Stig
thanks for all your efforts DAJ, I have just installled your weather console as a meny option on my website,
but do not get any data into the console, it writes undefined in all boxes, could you tell me what I am missing
kind regards
Stig
my site:
www.hareskovvejr.dk
Re: New addon: Live data on the web
Posted: Mon 12 Apr 2010 6:18 pm
by steve
Stig wrote:thanks for all your efforts DAJ, I have just installled your weather console as a meny option on my website,
but do not get any data into the console, it writes undefined in all boxes, could you tell me what I am missing
You've entered the URL of your realtime.txt file in wconsole.js as
http://www.hareskovvejr.dk/realtime/realtime.txt which gives a 404; it looks like it should be
http://www.hareskovvejr.dk/realtime.txt
Re: New addon: Live data on the web
Posted: Mon 12 Apr 2010 6:38 pm
by daj
You could also get away with this...
Code: Select all
var realtime_location="realtime.txt";
As your realtime file seems to be in the root of your web server
Re: New addon: Live data on the web
Posted: Mon 12 Apr 2010 6:49 pm
by Stig

thanks DAJ, i had uploaded the wconsole.js from a weather console map copy on another computer-
thank you for your help
Stig
www.Hareskovvejr.dk
Re: New addon: Live data on the web
Posted: Mon 03 May 2010 3:32 pm
by Synewave
gemini06720 wrote:daj wrote:Yes, I'm trying to capture that problem and get it to ignore it. For now, I resolve it by staggering the timing. So if Cumulus is updating every 5 seconds, refresh the console maybe every 7
David how about a loop within the JavaScrip file ... and no, I do not know how to do it...
In one of my PHP script I have the following:
Code: Select all
$realtime = 'realtime.txt'; // relative FILE location of realtime.txt
$fileOpenTries = 3; // number of open retries for realtime files
$retrySleepTime = 5; // seconds to wait before next open retry
...
for ($i = $fileOpenTries; $i > 0; $i--) {
$dataraw = file_get_contents($realtime);
if ($dataraw===false)
{
sleep($retrySleepTime);
}
else
{
break;
}
...
What the code snippet basically do is:
- it tries to open the file;
- if it cannot get the content of the file, it waits for 5 seconds (as setup) and tries again to open the file;
- it will repeat the same open/wait loop 3 times (as setup) and then give up...
But, that is a 15 seconds loop and that might be what is needed inside the JavaScript to eventually get the 'realtime.txt' information...
Just a suggestion...

Hi David,
Did you come up with anything based on Ray's suggestion to prevent the 'undefined' data problem?
I've just been playing with the code for the past few hours and not really got anywhere with it. It's not just for the wconsole, I'm using a modified version of your script to drive most of my pages as realtime.
Re: New addon: Live data on the web
Posted: Mon 03 May 2010 8:34 pm
by gemini06720
Synewave wrote:...Did you come up with anything based on Ray's suggestion to prevent the 'undefined' data problem?
I've just been playing with the code for the past few hours and not really got anywhere with it. It's not just for the wconsole, I'm using a modified version of your script to drive most of my pages as realtime.
Paul, I have been looking at other forums where similar questions/requests have been made, about some JavaScript code to check if a file exist and do something if it does exist and something else if it does not exist.
From what I have read, here are the consensus seems to be: "For security reasons JavaScript does not have any functions for file handling... Javascript is called "client-side programming" for a reason - it cannot manipulate server files or client files... Would you really want a JavaScript deleting your hard drive while you were surfing the Net...".
One user suggested the use of
XMLHttpRequest Object - also check
XMLHttpRequest Object for the use of the code...
The
W3Schools site has, indeed, great information (ressources)...
Re: New addon: Live data on the web
Posted: Mon 10 May 2010 6:30 pm
by n9mfk
David,
the pop out does not seem to work in ff it works in ie
http://www.n9mfk.com/wconsole.html
Beau
Re: New addon: Live data on the web
Posted: Mon 10 May 2010 9:50 pm
by gemini06720
n9mfk wrote:...the pop out does not seem to work in ff it works in ie...
Beau, on my computer in the four browsers that I have installed, the pop-up weather console only works properly (opening in a new smaller window) in the Google Chrome browser:
- in Opera, it opens what appears to be another windows but it is more like a frame within the original (starting) windows;
- in Internet Explorer, it opens a new full size window (because that is the way I have Internet Explorer setup);
- in Firefox, it also opens a full size window (because that is the way I have Firefox setup).
But the small lower-right-corner click-on box does open a new weather console in all 4 browsers...

Re: New addon: Live data on the web
Posted: Mon 10 May 2010 11:15 pm
by n9mfk
Ray, what is odd this on works
http://www.grantownweather.co.uk/wconsole.html
but mine does not
Re: New addon: Live data on the web
Posted: Tue 11 May 2010 8:15 am
by gemini06720
n9mfk wrote:...but mine does not
Beau, your weather console might not work with your Firefox, but it does work with my Firefox...
Try running Firefox in safe mode, meaning that Firefox will not load any of it extensions ... might be worth the try...
Re: New addon: Live data on the web
Posted: Thu 20 May 2010 12:28 pm
by Arnie
Hi David
Great program, unfortunatly I can't seem to get it to work
Ive saved all the files to the root directory
www.wentworthvilleweather.com/wconsole.html
The "Weather Console" just does not load the data
Msg on screen "Reading data, one moment please"
That's as far as it goes
Any ideas
Regatds
Brian
Re: New addon: Live data on the web
Posted: Thu 20 May 2010 12:52 pm
by steve
Arnie wrote:The "Weather Console" just does not load the data
Msg on screen "Reading data, one moment please"
You've got an extra 'var' keyword in your wconsole.js:
var var realtime_location="realtime.txt";
It should be:
var realtime_location="realtime.txt";
Re: New addon: Live data on the web
Posted: Thu 20 May 2010 8:14 pm
by Arnie
Working great
Thanks Steve
Re: New addon: Live data on the web
Posted: Mon 23 Aug 2010 12:53 am
by Areco747
Why is not forecast in my "Weatherconsole"
http://www.arecoclima.com.ar/console/wconsole.html
Can you help?
Many Thanks!
Re: New addon: Live data on the web
Posted: Mon 23 Aug 2010 2:32 am
by gemini06720
Mauricio, when I access the link you provided, the weather console was displaying weather information - see the clip from your Web page: