Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Legacy Cumulus 1 release 1.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

If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080

Cumulus, XML, AJAX and translations

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderator: daj

User avatar
aadal
Posts: 168
Joined: Tue 04 Nov 2008 8:07 pm
Weather Station: WH 1080
Location: Skodje
Contact:

Re: Cumulus, XML, AJAX and translations

Post by aadal »

MarkB wrote:
aadal wrote:Then it gos days before caling on xml file you need to refresh to update page.
That would be around 115.75 days at a guess :D

I'm sorry, but this only avoids the problem. It still makes 22 consecutive calls to xmlreturn.log

Code: Select all

if (!($fp=@fopen("./cumulusdata.xml", "r"))) die ("Couldn't open XML.");
when the timer expires. This has to be expensive...

:cry: Mark
Aha, cant even get the 22 once without die ?
Yes must be expensive one.....
  • Windows Vista
Image

Image
ritchie
Posts: 42
Joined: Mon 02 Feb 2009 10:25 pm
Weather Station: WS 1081
Operating System: windows 10
Location: Rieti Italy

Re: Cumulus, XML, AJAX and translations

Post by ritchie »

The principle behind the routine is that it waits till the DOM is complete before looking at updating the spans or divs.
And yes, it then does place a request for every token in the html page, which isn't a great deal different to assembling a page that has lots of graphics or other mixed content.
Each div is assigned a class that represents either a refresh or once only request, both of which explain themselves, and the javascript objects to serve them are then setup.
I am surprised that your server cannot cope with 'just' the 22 once only requests.

If you do it the way Aadal has done, you don't need xml refreshes, so you might as well just have a php page that dishes up the data as a once off, that is what I have done with the banner script; I adopted it to read the xml file. But whatever way you look at it, it won't be AJAX !

I can write the routine to have xmlhttprequests instead of htmlresponse, however it does make the code in the web page a lot more complex for the user trying to deploy their web page. Because they will have to know how to associate the xml response with all their tokens - too complex for what I wanted to be a flexible easily deployed solution.

I guess you need to put a new server onto your christmas present list :P
User avatar
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: Cumulus, XML, AJAX and translations

Post by beteljuice »

It does seem to have rather excessive overheads, I was wondering why some of the sites take an 'obvious' time to build the data.

One of the good things about AJAX xml is that you ask for what you want.

One of the bad things about AJAX xml is that you ask for what you want :shock:
ie. every 'variable' is a new search of the xml base; whereas if you parse a text file you do everything in one go, then process what you want.
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
MarkB
Posts: 68
Joined: Tue 13 Jan 2009 4:03 pm
Weather Station: Elecsa 6975 (Fine Offset)
Contact:

Re: Cumulus, XML, AJAX and translations

Post by MarkB »

That seems to about sum it up.

I'm impressed; it'd take me many more words than that! :mrgreen:
Image
gateway2capecod
Posts: 23
Joined: Sun 15 Feb 2009 8:22 pm
Weather Station: Davis Vantage Pro2
Location: West Wareham, Ma. USA
Contact:

Re: Cumulus, XML, AJAX and translations

Post by gateway2capecod »

Hello..

I decided to try out the ajaxindex.html pages for Cumulus and have set up a test page here for you to have a look at:

http://www.gateway2capecod.com/cumulus/ajaxindex.htm

The only 2 pages I configured working for now are the "NOW" page and the "Webcam" page on these templates. I also added in a Real time clock to top section of the ajaxindex.htm page. At the bottom of the page I added in the real time wind data gauges and removed the "Yesterday" and "Records" sections that were originally there.
At the bottom section of my 'Webcam' page I added in a Weather underground banner, which shows conditions both in Metric and Standard measurments. These weather underground banners are available at weather underground website.

at the current time I do not have the real time processing enabled, so my test page using the ajaxindex is only updating every 15 minutes. I did have it enabled earlier and it seems to work nicely for me.

The ajaxindex pages are just for me to test out and are not my official site. I am also running the cumulus pages with my Sinorca gradient templates as a testing out process to see how Cumulus runs overall and also test out the software. My Regular cumulus page and Main weather website can be viewed by clicking links in my signature below, if you have not already saw those.

...Chris
My Cumulus Site is Here: http://www.gateway2capecod.com/cumulus
My Main Site is here: http://www.gateway2capecod.com

Image
User avatar
aadal
Posts: 168
Joined: Tue 04 Nov 2008 8:07 pm
Weather Station: WH 1080
Location: Skodje
Contact:

Re: Cumulus, XML, AJAX and translations

Post by aadal »

Hi Chris
Nice but page load slow here in Norway...
Ups must say, my server is in LA loding fine here...
  • Windows Vista
Image

Image
User avatar
w5afw
Posts: 154
Joined: Thu 29 Jan 2009 8:48 pm
Weather Station: ws-2315
Location: Houston, the Eagle has landed, TX
Contact:

Re: Cumulus, XML, AJAX and translations

Post by w5afw »

nice Chris...how do you gradiate your header color; also, what banner php template are you using?
W5AFW, Lex

Image
User avatar
w5afw
Posts: 154
Joined: Thu 29 Jan 2009 8:48 pm
Weather Station: ws-2315
Location: Houston, the Eagle has landed, TX
Contact:

Re: Cumulus, XML, AJAX and translations

Post by w5afw »

Richie--are you working on an update for your template package? specifically, do you have an updated version of the xml process file which includes all the current tags? I cannot seem to find or use some of the "yesterday" tags which I find in the realtime.txt file.
W5AFW, Lex

Image
ritchie
Posts: 42
Joined: Mon 02 Feb 2009 10:25 pm
Weather Station: WS 1081
Operating System: windows 10
Location: Rieti Italy

Re: Cumulus, XML, AJAX and translations

Post by ritchie »

Yes - on my list of 'to dos'
Will probably be done this weekend, watch this space :D
Image
ritchie
Posts: 42
Joined: Mon 02 Feb 2009 10:25 pm
Weather Station: WS 1081
Operating System: windows 10
Location: Rieti Italy

Re: Cumulus, XML, AJAX and translations

Post by ritchie »

Latest version is attached.

ajaxindex.htm has the # removed from all tags, so you will need to update your own index page accordingly. Copy and paste the javascript from the package ajaxindex.htm, replacing the script at the start of the page.

The XML template probably has all the latest tags in it, please let me know if any are missing !!

Enjoy :roll:
You do not have the required permissions to view the files attached to this post.
Image
User avatar
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: Cumulus, XML, AJAX and translations

Post by beteljuice »

File comment: Latest version of ritchies AJAX system for Cumulus ;)

There are at least three others :D
Image
......................Imagine, what you will KNOW tomorrow !
ritchie
Posts: 42
Joined: Mon 02 Feb 2009 10:25 pm
Weather Station: WS 1081
Operating System: windows 10
Location: Rieti Italy

Re: Cumulus, XML, AJAX and translations

Post by ritchie »

beteljuice wrote:File comment: Latest version of ritchies AJAX system for Cumulus
:arrow: Picky or pedantic :roll: what does it matter how the file is described :?:
Image
User avatar
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: Cumulus, XML, AJAX and translations

Post by beteljuice »

ritchie wrote:... Picky or pedantic
None of the above

There are a significant number of html newbies, never mind DHTML, JavaScript, XML, php etc.
There are at least four flavours of AJAX, mentioned one way or another in double that number of threads.

This thread has a very similar title to some other threads, ... and so on.

All I was suggesting (albeit in a meandering way) was that every page or so you 'badge' your product to help an already confused audience.
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
w5afw
Posts: 154
Joined: Thu 29 Jan 2009 8:48 pm
Weather Station: ws-2315
Location: Houston, the Eagle has landed, TX
Contact:

Re: Cumulus, XML, AJAX and translations

Post by w5afw »

nice variation, application, demonstration, example, model and tool. thanks for updating your earlier contributtion and thanks for sharing, Ritchie! cheers, lex
W5AFW, Lex

Image
ritchie
Posts: 42
Joined: Mon 02 Feb 2009 10:25 pm
Weather Station: WS 1081
Operating System: windows 10
Location: Rieti Italy

Re: Cumulus, XML, AJAX and translations

Post by ritchie »

Say what you want, you are being both.
I created my routines to repay Steve's contribution and bolster the community.
I did not expect to be picked upon for refering to my own code, regardless of how I do it.
Whether I badge the product or not is irrelevant, I made a simpe reference to the AJAX code I had written and posted in MY thread, that I started.
I made it quite clear at the onset that the code was not for beginners, so you are now undermining the readers of this post by implying that they won't know what code I am referring to. I do not get the impression that any readers of this thread are confused in any way, far from it. If they were I would not have continued with it.

So if you don't like it get out of this thread, and let those that want to, enjoy what they are doing here.

beteljuice wrote:
ritchie wrote:... Picky or pedantic
None of the above

There are a significant number of html newbies, never mind DHTML, JavaScript, XML, php etc.
There are at least four flavours of AJAX, mentioned one way or another in double that number of threads.

This thread has a very similar title to some other threads, ... and so on.

All I was suggesting (albeit in a meandering way) was that every page or so you 'badge' your product to help an already confused audience.
Image
Post Reply