Welcome to the Cumulus Support forum.
Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024
Cumulus MX V4 beta test release 4.0.0 (build 4018) - 28 March 2024
Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014 (a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)
Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki
Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024
Cumulus MX V4 beta test release 4.0.0 (build 4018) - 28 March 2024
Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014 (a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)
Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki
Help with Java
Moderator: daj
- BrendanPratt
- Posts: 28
- Joined: Sat 11 Jun 2011 7:52 am
- Weather Station: Aercus
- Operating System: Windows 8
- Location: Te Puke
- Contact:
Help with Java
Hi all
Well I am stuck on a issue, I want to call a realtime.txt from another host, but when I enter the path it dose not work.
This is the code if the Javascript was in the same file as the cumulus realtime.txt file on the host.
var realtime_location="realtime.txt";
But I can't get it call another realtime.txt file from another cumulus install on another host.
what would be the command?
Thanks all.
Brendan
Well I am stuck on a issue, I want to call a realtime.txt from another host, but when I enter the path it dose not work.
This is the code if the Javascript was in the same file as the cumulus realtime.txt file on the host.
var realtime_location="realtime.txt";
But I can't get it call another realtime.txt file from another cumulus install on another host.
what would be the command?
Thanks all.
Brendan
http://www.tepukeweather.co.nz live and up to date weather information. Website design FrameIT - http://www.frame-it.co.nz
- steve
- Cumulus Author
- Posts: 26702
- Joined: Mon 02 Jun 2008 6:49 pm
- Weather Station: None
- Operating System: None
- Location: Vienne, France
- Contact:
Re: Help with Java
I think the answer is that Javascript does not allow cross-domain access, because it's a security risk.
Steve
- BrendanPratt
- Posts: 28
- Joined: Sat 11 Jun 2011 7:52 am
- Weather Station: Aercus
- Operating System: Windows 8
- Location: Te Puke
- Contact:
Re: Help with Java
Bugger....
http://www.tepukeweather.co.nz live and up to date weather information. Website design FrameIT - http://www.frame-it.co.nz
-
- Posts: 1700
- Joined: Mon 10 Aug 2009 10:16 pm
- Weather Station: No weather station
- Operating System: No operating system
- Location: World...
Re: Help with Java
Brendan, you would have better chances of accomplishing that task if you were to use PHP as PHP is a server-side language whereas JavaScript is a user-side language.
Although I have been 'playing' with PHP for the past 6-7 years, unfortunately, my knowledge on how such a task can be accomplished is very very limited...
Although I have been 'playing' with PHP for the past 6-7 years, unfortunately, my knowledge on how such a task can be accomplished is very very limited...
- mcrossley
- Posts: 12695
- Joined: Thu 07 Jan 2010 9:44 pm
- Weather Station: Davis VP2/WLL
- Operating System: Bullseye Lite rPi
- Location: Wilmslow, Cheshire, UK
- Contact:
Re: Help with Java
My PHP is even more limited, but cURL springs to mind?
- GraemeT
- Posts: 312
- Joined: Wed 21 Oct 2009 11:19 am
- Weather Station: La Crosse WS-2355 & WS-2306
- Operating System: Windoze 7, 10, 11
- Location: Bayswater, Australia
- Contact:
Re: Help with Java
Cheers,
Graeme.
Graeme.
- beteljuice
- Posts: 3292
- Joined: Tue 09 Dec 2008 1:37 pm
- Weather Station: None !
- Operating System: W10 - Threadripper 16core, etc
- Location: Dudley, West Midlands, UK
Re: Help with Java
Do you have PHP ?
Do you want to process the file with JavaScript or PHP ?
IS IT YOUR DATA !
Do you want to process the file with JavaScript or PHP ?
IS IT YOUR DATA !
......................Imagine, what you will KNOW tomorrow !
- BrendanPratt
- Posts: 28
- Joined: Sat 11 Jun 2011 7:52 am
- Weather Station: Aercus
- Operating System: Windows 8
- Location: Te Puke
- Contact:
Re: Help with Java
Yes its my data (to start with) and one other from my mates station.
I do have PHP,
I do have PHP,
http://www.tepukeweather.co.nz live and up to date weather information. Website design FrameIT - http://www.frame-it.co.nz
-
- Posts: 1700
- Joined: Mon 10 Aug 2009 10:16 pm
- Weather Station: No weather station
- Operating System: No operating system
- Location: World...
Re: Help with Java
Brendan, if you are interested in learning something new, you might want to download and look at the code within Ken True's PHP/AJAX Website Template Sets (I would suggest the world templates) - I know, this might not be the 'easy-way-out' most people are expecting, but it would be a rewarding learning experience.
Ken uses a function called 'fetchUrlWithoutHanging' (that function name is found in the 'check-fetch-times.php' template, but the same/similar function or under a slightly different name is also found in many other templates - a search for the word 'WithoutHanging' should provide many results) - the function is used to get contents from one URL and to return it as a string. Depending on how much protection and processing is needed, the function can be a few lines of code or many lines of code (that is why I am not posting any of the code).
Ken uses a function called 'fetchUrlWithoutHanging' (that function name is found in the 'check-fetch-times.php' template, but the same/similar function or under a slightly different name is also found in many other templates - a search for the word 'WithoutHanging' should provide many results) - the function is used to get contents from one URL and to return it as a string. Depending on how much protection and processing is needed, the function can be a few lines of code or many lines of code (that is why I am not posting any of the code).
- beteljuice
- Posts: 3292
- Joined: Tue 09 Dec 2008 1:37 pm
- Weather Station: None !
- Operating System: W10 - Threadripper 16core, etc
- Location: Dudley, West Midlands, UK
Re: Help with Java
That's as good an education as you can get if you can get your head around it
Learning the 'routines' for grab and parsing will give you lots of new ideas
You don't say if you want to cyclically get the realtime.txt or do it as 'one-shot', that will make a difference to the solution you use, but the basics will be the same.
Learning the 'routines' for grab and parsing will give you lots of new ideas
You don't say if you want to cyclically get the realtime.txt or do it as 'one-shot', that will make a difference to the solution you use, but the basics will be the same.
Last edited by beteljuice on Mon 02 Apr 2012 11:47 am, edited 1 time in total.
......................Imagine, what you will KNOW tomorrow !
- BrendanPratt
- Posts: 28
- Joined: Sat 11 Jun 2011 7:52 am
- Weather Station: Aercus
- Operating System: Windows 8
- Location: Te Puke
- Contact:
Re: Help with Java
Hmm I have been looking at PHP... seems to be the way to go.. so I will have to site down and learn the code.... O fun
Thanks you for all your help
Thanks you for all your help
http://www.tepukeweather.co.nz live and up to date weather information. Website design FrameIT - http://www.frame-it.co.nz
- GraemeT
- Posts: 312
- Joined: Wed 21 Oct 2009 11:19 am
- Weather Station: La Crosse WS-2355 & WS-2306
- Operating System: Windoze 7, 10, 11
- Location: Bayswater, Australia
- Contact:
Re: Help with Java
Brendan,
A good place to start is http://www.w3schools.com
It has tutorials covering php, javascript, html and just about everything in between.
A good place to start is http://www.w3schools.com
It has tutorials covering php, javascript, html and just about everything in between.
Cheers,
Graeme.
Graeme.