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

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

Cumulus, XML, AJAX and translations

Post by ritchie »

I didn't get much reaction from volunteers to test our system, so I thought that I would let everybody loose on it to see what happens.

:o Be warned this is not for the feint hearted or novice web user :o

If you take the time, you will find that all of the Cumulus tokens and any additional data you want are exposed and available to your web apps - including translation into another laguage if you so wish it.
The sample web page shows a few of the tokens, and we have converted the php banner script too.
Take a look and see what luck you have, remember if you break your system, it's your not ours :mrgreen:

NOTE: Download updated - see later post
You do not have the required permissions to view the files attached to this post.
Last edited by ritchie on Tue 14 Apr 2009 9:32 am, edited 2 times in total.
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 There, Thanks!

The CumulusAjax is runing here http://www.aadal.org/weather/ajaxindex.htm

:lol:
  • Windows Vista
Image

Image
User avatar
Paul C
Posts: 538
Joined: Thu 19 Jun 2008 7:45 am
Weather Station: Davis VP2 with solar
Operating System: Windows 10
Location: Brampton, Cumbria, UK
Contact:

Re: Cumulus, XML, AJAX and translations

Post by Paul C »

I dont quite understand the location of the cumulusdata.xml file. I am using this is the file that obtains the weather data ?

Why do you place in a file called c:\cumulus\templates ?

I have followed the help file to the letter but as yet I cant get it to work

sample page - http://www.bramptonweather.co.uk/cumulu ... xindex.htm

Cumulus doesnt appear to be processing the xml file, its not being uploaded as far as I can tell
Paul C
Brampton, Cumbria, UK
117m ASL
http://www.bramptonweather.co.uk
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 »

Paul C wrote:I dont quite understand the location of the cumulusdata.xml file. I am using this is the file that obtains the weather data ?

Why do you place in a file called c:\cumulus\templates ?

I have followed the help file to the letter but as yet I cant get it to work

sample page - http://www.bramptonweather.co.uk/cumulu ... xindex.htm

Cumulus doesnt appear to be processing the xml file, its not being uploaded as far as I can tell

Copy xmldata.tpl to your Cumulus PC in a folder that is outside of the main installation.
An example is c:\cumulus\templates
Setup Cumulus, under configuration/internet settings: On the files tab, add in the xmldata.tpl into local filenames. In Remote filenames enter your website destinantion folder and cumulusdata.xml. Tick the process box.

Image

Local xmldata.tpl to web cumulusdata.xml
Last edited by aadal on Mon 23 Feb 2009 8:13 pm, edited 3 times in total.
  • Windows Vista
Image

Image
User avatar
Paul C
Posts: 538
Joined: Thu 19 Jun 2008 7:45 am
Weather Station: Davis VP2 with solar
Operating System: Windows 10
Location: Brampton, Cumbria, UK
Contact:

Re: Cumulus, XML, AJAX and translations

Post by Paul C »

aadal wrote:
Paul C wrote:I dont quite understand the location of the cumulusdata.xml file. I am using this is the file that obtains the weather data ?

Why do you place in a file called c:\cumulus\templates ?

I have followed the help file to the letter but as yet I cant get it to work

sample page - http://www.bramptonweather.co.uk/cumulu ... xindex.htm

Cumulus doesnt appear to be processing the xml file, its not being uploaded as far as I can tell

Copy xmldata.tpl to your Cumulus PC in a folder that is outside of the main installation.
An example is c:\cumulus\templates
Setup Cumulus, under configuration/internet settings: On the files tab, add in the xmldata.tpl into local filenames. In Remote filenames enter your website destinantion folder and cumulusdata.xml. Tick the process box.
I dont quite understand where cumulusdata.xml comes into it all of a sudden ? - can you help me with this bit please.

Image

Just seen your last, doing that now !
Paul C
Brampton, Cumbria, UK
117m ASL
http://www.bramptonweather.co.uk
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 »

I did say only the brave 8-)

cumulusdata.xml is created as an alternative to realtime.txt It has all of the available tags that you would normally embed into a web page template prior to it being processed, last count was about 110 I believe.
It is created by the template update process built into cumulus, its just not a 'real' web page, just an XML one.

The ajaxindex.htm file shows how it can be used. At this stage it isn't very productive because we are not processing the data - yet. ie creating dynamically changing graphics etc etc. However the page will be refreshed every 3 minutes on my system without the need for messy Javascript reloads. It is a true AJAX implementation.

Originally I created the output so that I could see the data via the XML in my Home Seer HSTouch setup. But why stop there !
Via the source template you can deliver whatever data you think appropriate for your systems. The other example is the banner, you will see mine is below. It doesn't yet differ signifcantly from the original, but once again, some nifty processing of the data via the output and we can have snacky graphics, localised text etc etc

The processing script has translation capabilities built into it for those that need it, and the more who contribute their translations, the better it will become.

Let it take it where you want it to go
Image
User avatar
Paul C
Posts: 538
Joined: Thu 19 Jun 2008 7:45 am
Weather Station: Davis VP2 with solar
Operating System: Windows 10
Location: Brampton, Cumbria, UK
Contact:

Re: Cumulus, XML, AJAX and translations

Post by Paul C »

Dont worry I am brave aswell as thick but I get there in the end.

http://www.bramptonweather.co.uk/cumulu ... xindex.htm

Its working, no moon image yet.

Edit still no moon and the clouds come and go ?, very odd. even my son noticed that !

Can you add in some solar values when you have chance !. tks
Paul C
Brampton, Cumbria, UK
117m ASL
http://www.bramptonweather.co.uk
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 »

The page work fine but cant get the translations to work.

http://www.aadal.org/weather/ajaxindex.htm

I put en_no'=> array( in xmlreturn.php is there more to set?


:?
  • 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 »

aadal wrote:The page work fine but cant get the translations to work.
http://www.aadal.org/weather/ajaxindex.htm
I put en_no'=> array( in xmlreturn.php is there more to set?
:?
You need to put lang: en_no into one of the parameter sections of the page script, or you can change the code within the xmlreturn.php code of you want.
I am out for another day, but I will update the code as an example for you. It will possibly make it easier for others too.
Thanks for the feedback.
Image
Marian
Posts: 4
Joined: Fri 17 Oct 2008 9:16 pm
Weather Station: Oregon WMR-928
Location: Toronto, Ontario,Canada
Contact:

Re: Cumulus, XML, AJAX and translations

Post by Marian »

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 »

I have changed the php code to make translations slightly easier to implement and manage.
You can now set the language in the server side program. There is a varaiable named $LANG:
You can either leave LANG blank OR assign a value to it within the program.
In either case, you can override it from the parameters as needed for the call, so you can mix the native output with your language of choice - gives the opportunity for a full mulitlingual page if you so wish !!
If instructed, it will attempt to translate everything that is not numeric, which also keeps it a little simpler !

BE WARNED - I have not tested the translation routine yet :o
I just threw the code in, it doesn't break the standard operation, and looks like it will work :roll:

I have added some Italian into the language lookup, and will develop that as I can handle that language OK
Once I have a full Italian translation working, I will publish a page showing that the routine works, in the meantime try it and see.

The new code is attached
ciao :D
Last edited by ritchie on Thu 26 Feb 2009 2:12 pm, edited 1 time in total.
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 »

OK - I tested the translations and they work, now :lol:

I have placed the actual language section into a separate file as that will be easier to maintain on a long term basis.
Attached is the working code and include file, you can take a look at a mix of changes at my own weather/ajaxindex.htm output.

Have Fun.
You do not have the required permissions to view the files attached to this post.
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 »

Thanks ritchie
:D
The translation is working fine now.
Cant load the lokal character.
Image
And thise inside a tag cant take.
17:14 on 26 februar 2009
In Norwegian:
17:14 den 26 februar 2009
http://www.aadal.org/weather/ajaxindex.htm
  • 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 »

I do not know about the special Norwegian characters, perhaps you could PM me with them embedded and I can see what happens here.

As far as that tag date goes, you will have to use the individual date tags to make that, take a look in my page and you will see that the Italian date is composed of all the individual tags.
I could program a routine to take that big date tag and convert it, but I am trying to keep the system as generic as possible to make the calls simple (and the program - and my job !!!)

What's the weather feel like over your way - I have a visit to Oslo planned for early March and I don't know whether to pack shorts or not :mrgreen:
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 »

ritchie wrote:I do not know about the special Norwegian characters, perhaps you could PM me with them embedded and I can see what happens here.

As far as that tag date goes, you will have to use the individual date tags to make that, take a look in my page and you will see that the Italian date is composed of all the individual tags.
I could program a routine to take that big date tag and convert it, but I am trying to keep the system as generic as possible to make the calls simple (and the program - and my job !!!)

What's the weather feel like over your way - I have a visit to Oslo planned for early March and I don't know whether to pack shorts or not :mrgreen:
Hi ritcie
Where is link to your page en_it?
I solved the spesial norwegian characters i use:
'Waxing Crescent' => 'Voksende m&#229ne',
The weather in Oslo is on the other side of the mountains from here, but then the sun is start working longer hourer.
I think its early to bring shorts :)
Here is Weather statistics for Oslo http://www.yr.no/place/Norway/Oslo/Oslo ... stics.html
  • Windows Vista
Image

Image
Post Reply