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 realtime.txt file reader

Discussion and support for 3rd-party (non-Sandaysoft) tools for Cumulus
User avatar
phtvs
Posts: 96
Joined: Sat 04 Dec 2010 10:11 am
Weather Station: ws4000
Operating System: win7
Location: Lemmer

Re: Cumulus realtime.txt file reader

Post by phtvs »

Made another usefull script for using with the view-realtime.php script.

This script shows a table with all the strings that are used by the view-realtime.php script

Unpack the .rar with winrar and put the realtime-helper.php script in the same directory as the view-realtime.php file.

Point your browser to:

http://www.linktoyoursite/realtime-helper.php

Have fun with it!
You do not have the required permissions to view the files attached to this post.
User avatar
nitrx
Posts: 1297
Joined: Sun 13 Dec 2009 1:21 pm
Weather Station: WH1080
Operating System: Windows 10
Location: Apeldoorn The Netherlands
Contact:

Re: Cumulus realtime.txt file reader

Post by nitrx »

almost
<td width="119" height="39" align="center"><? echo $forecastnumber; ?>;</td>
and

<td width="119" height="39" align="center"><? echo $wdir; </td> should be <td width="119" height="39" align="center"><? echo $wdir; ?></td> without the bold-marked semicolumn ;)

edit makrup duesnt work on the forum :roll: http://www.apeldoorn.tk/weer/realtime-helper.php
User avatar
daj
Posts: 2041
Joined: Tue 29 Jul 2008 8:00 pm
Weather Station: WH1081
Operating System: Pi & MX
Location: SW Scotland
Contact:

Re: Cumulus realtime.txt file reader

Post by daj »

Shriek!!!! :o :o :o

Please do not use the PHP short open tag, especially if you are sharing PHP. Not all PHP installations will have this enabled by default.

CORRECT

Code: Select all

<?php .....
NOT

Code: Select all

<?
There are also some errors in the HTML, the first quite serious...

Code: Select all

<body <body bgcolor="#F9F9F9">
Need to remove the duplicate "<body "

And right at the end of the code you open a <center> tag but do not close it. Not as serious but some browsers will have a problem with it
David
kippfordweather.uk
Cumulus MX & Raspberry Pi
User avatar
phtvs
Posts: 96
Joined: Sat 04 Dec 2010 10:11 am
Weather Station: ws4000
Operating System: win7
Location: Lemmer

Re: Cumulus realtime.txt file reader

Post by phtvs »

oeps...

I didnt see that...

Maby I was to quick with posting the file.

I correct the errors first tomorrow morning and post te good version.

Thanks for helping!
User avatar
phtvs
Posts: 96
Joined: Sat 04 Dec 2010 10:11 am
Weather Station: ws4000
Operating System: win7
Location: Lemmer

Re: Cumulus realtime.txt file reader

Post by phtvs »

got all the errors out of the script now.

Updated my first post with the new version!
User avatar
phtvs
Posts: 96
Joined: Sat 04 Dec 2010 10:11 am
Weather Station: ws4000
Operating System: win7
Location: Lemmer

Re: Cumulus realtime.txt file reader

Post by phtvs »

daj wrote:Shriek!!!! :o :o :o

Please do not use the PHP short open tag, especially if you are sharing PHP. Not all PHP installations will have this enabled by default.

CORRECT

Code: Select all

<?php .....
NOT

Code: Select all

<?
There are also some errors in the HTML, the first quite serious...

Code: Select all

<body <body bgcolor="#F9F9F9">
Need to remove the duplicate "<body "

And right at the end of the code you open a <center> tag but do not close it. Not as serious but some browsers will have a problem with it

Thanks for reporting my miss typo's!!

Corrected them and update my first post with the new script!

Theo
User avatar
daj
Posts: 2041
Joined: Tue 29 Jul 2008 8:00 pm
Weather Station: WH1081
Operating System: Pi & MX
Location: SW Scotland
Contact:

Re: Cumulus realtime.txt file reader

Post by daj »

Great -- well done so far with your scripts. Learning is so much fun (well I think so anyway)
David
kippfordweather.uk
Cumulus MX & Raspberry Pi
User avatar
phtvs
Posts: 96
Joined: Sat 04 Dec 2010 10:11 am
Weather Station: ws4000
Operating System: win7
Location: Lemmer

Re: Cumulus realtime.txt file reader

Post by phtvs »

daj wrote:Great -- well done so far with your scripts. Learning is so much fun (well I think so anyway)
Indeed, learning php is fun to do!
especially when you get compliments of scripting gurus like you 8-)
gemini06720
Posts: 1700
Joined: Mon 10 Aug 2009 10:16 pm
Weather Station: No weather station
Operating System: No operating system
Location: World...

Re: Cumulus realtime.txt file reader

Post by gemini06720 »

Theo, I looked at the original 'view-realtime.php' (and also at the latest release) and both files are very good for a PHP 'débutant' :) ) .

Using some of the code I was already using for my Web pages, I modified the original 'view-realtime.php' to include additional tags and a few additional functions. Some of the new code comes from the Weather Display/PHP/AJAX Website scripts/template (designed by Ken True) that I have been using for the past 4-5 years on my main weather pages.

The attached modified 'view-realtime-ray.php' is compatible with your 'view-realtime.php' and with 'realtime-helper.php' (you should rename that file to 'view-realtime-helper.php' so both files are next to each others on a directory listing ;) ).

I have also modified 'view-realtime-ray.php' to make it compatible with the format of the variables use in my Web pages (also the format of the variables used in my 'webtags' files): [link removed]
Last edited by gemini06720 on Wed 22 May 2013 10:22 pm, edited 1 time in total.
User avatar
phtvs
Posts: 96
Joined: Sat 04 Dec 2010 10:11 am
Weather Station: ws4000
Operating System: win7
Location: Lemmer

Re: Cumulus realtime.txt file reader

Post by phtvs »

To show what nice things you can do with the view-realtime.php script I have made a webpage.

DEMO: http://www.weerstation-lemmer.nl/cumulu ... onsole.php

This is a weatherconsole with "live"updates. Page refreshes every 15 seconds. (Could be more or less if you want)
User avatar
phtvs
Posts: 96
Joined: Sat 04 Dec 2010 10:11 am
Weather Station: ws4000
Operating System: win7
Location: Lemmer

Re: Cumulus realtime.txt file reader

Post by phtvs »

gemini06720 wrote:Theo, I looked at the original 'view-realtime.php' (and also at the latest release) and both files are very good for a PHP 'débutant' :) ) .

Using some of the code I was already using for my Web pages, I modified the original 'view-realtime.php' to include additional tags and a few additional functions. Some of the new code comes from the Weather Display/PHP/AJAX Website scripts/template (designed by Ken True) that I have been using for the past 4-5 years on my main weather pages.

The attached modified 'view-realtime-ray.php' is compatible with your 'view-realtime.php' and with 'realtime-helper.php' (you should rename that file to 'view-realtime-helper.php' so both files are next to each others on a directory listing ;) ).

I have also modified 'view-realtime-ray.php' to make it compatible with the format of the variables use in my Web pages (also the format of the variables used in my 'webtags' files): view-realtime-ray_2.php

Wauw!!! Looks fantastic! :clap:
I will have to take better a look at the script later today, maybe I can use it for the webpages I want to make.

Renaming the files is a good idea.

Im working on a few scripts for displaying the data from realtime.txt. One of them is almost ready.

PHP scripting is easyer for me then typing English ;-)

Theo
gemini06720
Posts: 1700
Joined: Mon 10 Aug 2009 10:16 pm
Weather Station: No weather station
Operating System: No operating system
Location: World...

Re: Cumulus realtime.txt file reader

Post by gemini06720 »

phtvs wrote:To show what nice things you can do with the view-realtime.php script I have made a webpage.
Nice work Theo... ;)
phtvs wrote:This is a weatherconsole with "live"updates. Page refreshes every 15 seconds. (Could be more or less if you want)
Ah! You disappoint me, you use the <META HTTP-EQUIV="Refresh" CONTENT="15"> tag to refresh your page ... and I thought you would have use some JavaScript... :D

Now you have to learn how to use more often an external CSS (cascading style sheet) file to put all that CSS/style coding... :twisted:
phtvs wrote:Im working on a few scripts for displaying the date from realtime.txt. One of them is almost ready.
If you look near the end of the 'view-realtime-ray.php' file you should find 2 functions (fixup_date and fixup_time) that should help you with the time/date display... :geek:
phtvs wrote:PHP scripting is easyer then typing English
Once one gets 'really' involved with PHP, one find PHP quite interesting and quite challenging... :lol:
User avatar
daj
Posts: 2041
Joined: Tue 29 Jul 2008 8:00 pm
Weather Station: WH1081
Operating System: Pi & MX
Location: SW Scotland
Contact:

Re: Cumulus realtime.txt file reader

Post by daj »

gemini06720 wrote:.... Ah! You disappoint me, you use the <META HTTP-EQUIV="Refresh" CONTENT="15"> tag to refresh your page ... and I thought you would have use some JavaScript... :D

Now you have to learn how to use more often an external CSS (cascading style sheet) file to put all that CSS/style coding... :twisted:
Baby steps Ray and one thing at a time. Let's not bombard Theo with everything at once.
David
kippfordweather.uk
Cumulus MX & Raspberry Pi
User avatar
phtvs
Posts: 96
Joined: Sat 04 Dec 2010 10:11 am
Weather Station: ws4000
Operating System: win7
Location: Lemmer

Re: Cumulus realtime.txt file reader

Post by phtvs »

daj wrote:
gemini06720 wrote:.... Ah! You disappoint me, you use the <META HTTP-EQUIV="Refresh" CONTENT="15"> tag to refresh your page ... and I thought you would have use some JavaScript... :D

Now you have to learn how to use more often an external CSS (cascading style sheet) file to put all that CSS/style coding... :twisted:
Baby steps Ray and one thing at a time. Let's not bombard Theo with everything at once.
:lol: :lol:

Have made a few changes to the webpage.

The forecast icon (right top of the screen) is now updated when $forecastnumber is changing and the image for daylight/nighttime is changing when the $isdaylight is changing in realtime.txt 8-)
User avatar
phtvs
Posts: 96
Joined: Sat 04 Dec 2010 10:11 am
Weather Station: ws4000
Operating System: win7
Location: Lemmer

Re: Cumulus realtime.txt file reader

Post by phtvs »

gemini06720 wrote:Now you have to learn how to use more often an external CSS (cascading style sheet) file to put all that CSS/style coding... :twisted:
Hi Ray,

I have changed the script a bit and also make use of an external CSS style sheet. I think the script is better organized this way.
Thanks for putting me on the right path!

http://www.weerstation-lemmer.nl/cumulu ... onsole.php

Next: I going to make the page refresh with javascript.... 8-)



Theo
Post Reply