Welcome to the Cumulus Support forum.

Latest Cumulus MX release 3.28.5 (build 3282) - 23 February 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

Extreme Weather script(s)

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

Moderator: daj

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: Extreme Weather script(s)

Post by beteljuice »

Any ideas, I have changed the time zone to Australia, would that have anything to do with it??
That has everything to do with it !

WMO METAR, TAF, SYNOPS etc. are alway Zulu time (UTC) - how else could you compare ?
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
gluepack
Posts: 460
Joined: Tue 22 Jan 2013 9:20 pm
Weather Station: PCE-FWS 20
Operating System: Win 7 Pro
Location: Zlatina, Bulgaria

Re: Extreme Weather script(s)

Post by gluepack »

Well, the source site could have done a conversion I suppose but (viz. my update to my last post), looking at the code for the source site (ogimet), there is no parameter for timezone so you are stuck with specifying UTC.
Image

PWS links: WundergroundIVARNAPR3CWOP/APRSE(W)2048PWSWeatherZLATINABGAwekas10631Twitter@Zlatina_weather
Station type: PCE-FWS 20…Webcam link: View south to edge of Provadisko plateau
User avatar
ace2
Posts: 679
Joined: Tue 14 Jan 2014 12:38 pm
Weather Station: maxkon ws-1081pc
Operating System: windows 7 & 8
Location: Adelaide, south Australia, Australia
Contact:

Re: Extreme Weather script(s)

Post by ace2 »

gluepack wrote:Well, the source site could have done a conversion I suppose but (viz. my update to my last post), looking at the code for the source site (ogimet), there is no parameter for timezone so you are stuck with specifying UTC.
At first it was working fine, But i suppose after a few hours it went up the sh**....
I'll change it back..... :(
CHRIS
Image
web site
http://www.ace2weather.com
Follow me on Twitter
http://tinyurl.com/kwlr9re
YouTube channel
http://tinyurl.com/lehwpgp
Facebook page
http://tinyurl.com/k3sap4s
Tiny URL links used
User avatar
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: Extreme Weather script(s)

Post by GraemeT »

Good find Gluepack, even better that it needs very little config. :clap:

http://weather.gktnet.com/world_extremes.php
Cheers,
Graeme.
User avatar
ace2
Posts: 679
Joined: Tue 14 Jan 2014 12:38 pm
Weather Station: maxkon ws-1081pc
Operating System: windows 7 & 8
Location: Adelaide, south Australia, Australia
Contact:

Re: Extreme Weather script(s)

Post by ace2 »

gluepack wrote:Well, the source site could have done a conversion I suppose but (viz. my update to my last post), looking at the code for the source site (ogimet), there is no parameter for timezone so you are stuck with specifying UTC.
Instead of changing the offset that effects the source grab, i created another offset to be only used on heading

Code: Select all

<?php
date_default_timezone_set('Australia/Adelaide');
$years       = date("Y");
$months      = date("m");
$monthnames  = date("F");
$days        = date("d");
$daynumbers  = date("jS");
$hours       = date("H");
?>
Then just change the heading I wanted changed to

Code: Select all

 <?php echo $days."/".$months."/".$years; ?> at <?php echo $hours ?>
(added a s to the end....)

So I don't think this will effect anything...I hope........
CHRIS
Image
web site
http://www.ace2weather.com
Follow me on Twitter
http://tinyurl.com/kwlr9re
YouTube channel
http://tinyurl.com/lehwpgp
Facebook page
http://tinyurl.com/k3sap4s
Tiny URL links used
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: Extreme Weather script(s)

Post by beteljuice »

It is important to stress that this is additional code (might be better to prefix var names with $title_ )

Also, in your modified 'title' you are not stating what TZ you are using. International visitors may be confused.
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
gluepack
Posts: 460
Joined: Tue 22 Jan 2013 9:20 pm
Weather Station: PCE-FWS 20
Operating System: Win 7 Pro
Location: Zlatina, Bulgaria

Re: Extreme Weather script(s)

Post by gluepack »

...not to mention that it doesn't work with 1/2 hour time zones ;)

I've attached my version (which corrects that) where I have made the following changes...

// VerJ.1 27-Aug-15 -- Increased arrays to include all countries and regions
// Added headings for country/region list
// Made output lines variable based on number of data items, if less than number of stations requested
// Added ability to choose alternate display time to UTC as additional line or replacement

Anyone is welcome to use it and, if you spot any problems, let me know.


Examples (not great ;) ) of heading change...

Adding line with alternate time zone
alttz.jpg
Adding line with alternate time zone with alternative name
altloc.JPG
Replacing UTC with alternate time zone
altrep.JPG
Demonstrating 1/2 hour time zone works
alttz.jpg
You do not have the required permissions to view the files attached to this post.
Image

PWS links: WundergroundIVARNAPR3CWOP/APRSE(W)2048PWSWeatherZLATINABGAwekas10631Twitter@Zlatina_weather
Station type: PCE-FWS 20…Webcam link: View south to edge of Provadisko plateau
User avatar
gluepack
Posts: 460
Joined: Tue 22 Jan 2013 9:20 pm
Weather Station: PCE-FWS 20
Operating System: Win 7 Pro
Location: Zlatina, Bulgaria

Re: Extreme Weather script(s)

Post by gluepack »

And the date changes too :)
altausmid.JPG
You do not have the required permissions to view the files attached to this post.
Image

PWS links: WundergroundIVARNAPR3CWOP/APRSE(W)2048PWSWeatherZLATINABGAwekas10631Twitter@Zlatina_weather
Station type: PCE-FWS 20…Webcam link: View south to edge of Provadisko plateau
User avatar
ace2
Posts: 679
Joined: Tue 14 Jan 2014 12:38 pm
Weather Station: maxkon ws-1081pc
Operating System: windows 7 & 8
Location: Adelaide, south Australia, Australia
Contact:

Re: Extreme Weather script(s)

Post by ace2 »

gluepack wrote:And the date changes too :)
That's perfect, thanks for that..
I was happy to leave what ever hour with 00 minutes, But this is so much better...

**I did need to edit the date to d/m/y(all done of course)**
**just an Australian thing**
CHRIS
Image
web site
http://www.ace2weather.com
Follow me on Twitter
http://tinyurl.com/kwlr9re
YouTube channel
http://tinyurl.com/lehwpgp
Facebook page
http://tinyurl.com/k3sap4s
Tiny URL links used
User avatar
gluepack
Posts: 460
Joined: Tue 22 Jan 2013 9:20 pm
Weather Station: PCE-FWS 20
Operating System: Win 7 Pro
Location: Zlatina, Bulgaria

Re: Extreme Weather script(s)

Post by gluepack »

Yes, I think I should put in a date format option.
Not too keen on the headings generally but too lazy to think of something else.

btw, your site needs a parameter to switch the damn crickets off, I keep thinking there is one in the house ;)
Image

PWS links: WundergroundIVARNAPR3CWOP/APRSE(W)2048PWSWeatherZLATINABGAwekas10631Twitter@Zlatina_weather
Station type: PCE-FWS 20…Webcam link: View south to edge of Provadisko plateau
User avatar
PaulMy
Posts: 3732
Joined: Sun 28 Sep 2008 11:54 pm
Weather Station: Davis VP2+ Cumulus1 / CummulusMX
Operating System: Windows8 / Windows10
Location: Komoka, ON Canada
Contact:

Re: Extreme Weather script(s)

Post by PaulMy »

Thanks Jeremy, you've done good work with this. I have it at http://www.komokaweather.ca/wxWorldExtremes.php

One difficulty I have is that I cannot get it to show my correct local time and not sure if it is my error understanding the settings or if it is a UTC minus issue. I have:
$where = 'Europe/London'; // Long timezone name e.g. 'Europe/Sofia' or 'UTC' if no alternate
$where_alt = 1; // 0 = use timezone name, 1 = use alternate name
$where_utc = 0; // 0 = use as well as UTC, 1 = use in place of UTC in display
$where_alternate = 'Komoka, ON Canada'; // Any text or null if using timezone name

// To open location links into another tab/window
// $newtab = 'target="_self"'; // opens link in same tab/window
$newtab = 'target="_blank"'; // opens link in a new tab/window
/////////////////////////////////////////////////////////////////////////////
//END SETTINGS///////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// Setup UTC date/time for heading and add/replace location date/time for specified alternate time zone
$utc_date = $month."/".$day."/".$year." at ".$hour.":00 UTC";
$where_date = null;
if ($where !== 'UTC')
{
$where_date = $month."/".$day."/".$year." ".$hour.":00";
$new_date = DateTime::createFromFormat( 'm/d/Y G:i', $where_date, new DateTimeZone('America/Toronto') );
in my settings and it shows UTC time plus Komoka, ON Canada as alternate but at URC plus 5 hours. Other time settings I've tried are all at UTC plus rather than UTC minus.

Any suggestions?
Paul
Davis Vantage Pro2+
C1 www.komokaweather.com/komokaweather-ca
MX www .komokaweather.com/cumulusmxwll/index.htm
MX www.komokaweather.com/cumulusmx/index.php
MX www.komokaweather.com/cumulusmx/index.html

Image
User avatar
ace2
Posts: 679
Joined: Tue 14 Jan 2014 12:38 pm
Weather Station: maxkon ws-1081pc
Operating System: windows 7 & 8
Location: Adelaide, south Australia, Australia
Contact:

Re: Extreme Weather script(s)

Post by ace2 »

gluepack wrote:btw, your site needs a parameter to switch the damn crickets off, I keep thinking there is one in the house ;)
There is actual 2 switches as such...
1. Large speaker below top heading :clap:

2. down the bottom speaker with the words 'Turns background audio OFF/ON. **On IOS & Android, this turns audio ON/OFF**' :clap:

See... :groan:
CHRIS
Image
web site
http://www.ace2weather.com
Follow me on Twitter
http://tinyurl.com/kwlr9re
YouTube channel
http://tinyurl.com/lehwpgp
Facebook page
http://tinyurl.com/k3sap4s
Tiny URL links used
User avatar
gluepack
Posts: 460
Joined: Tue 22 Jan 2013 9:20 pm
Weather Station: PCE-FWS 20
Operating System: Win 7 Pro
Location: Zlatina, Bulgaria

Re: Extreme Weather script(s)

Post by gluepack »

PaulMy...
Your $where should be 'America/Toronto'


There is a full list at https://en.wikipedia.org/wiki/List_of_t ... time_zones
Image

PWS links: WundergroundIVARNAPR3CWOP/APRSE(W)2048PWSWeatherZLATINABGAwekas10631Twitter@Zlatina_weather
Station type: PCE-FWS 20…Webcam link: View south to edge of Provadisko plateau
User avatar
PaulMy
Posts: 3732
Joined: Sun 28 Sep 2008 11:54 pm
Weather Station: Davis VP2+ Cumulus1 / CummulusMX
Operating System: Windows8 / Windows10
Location: Komoka, ON Canada
Contact:

Re: Extreme Weather script(s)

Post by PaulMy »

Thanks, got it now.

The first time I selected on a country/region other than ones I had opened before it gave a warning about "No such file ..." for lines 226-229 of the script but then a reload and all is good. After a few minutes and going back to the page now any country selected display correctly, so likely just a pause in creating the extremeCache_ file. All is good now.

Paul
Davis Vantage Pro2+
C1 www.komokaweather.com/komokaweather-ca
MX www .komokaweather.com/cumulusmxwll/index.htm
MX www.komokaweather.com/cumulusmx/index.php
MX www.komokaweather.com/cumulusmx/index.html

Image
User avatar
gluepack
Posts: 460
Joined: Tue 22 Jan 2013 9:20 pm
Weather Station: PCE-FWS 20
Operating System: Win 7 Pro
Location: Zlatina, Bulgaria

Re: Extreme Weather script(s)

Post by gluepack »

It might be my fault. I created a folder below cache and used explicit references to it.
Next update I will use the system cache folder and provide for an alternative sub-folder.
I notice that your 'World' works.
Also next update I will add ability to change date format, dmy or mdy.
Image

PWS links: WundergroundIVARNAPR3CWOP/APRSE(W)2048PWSWeatherZLATINABGAwekas10631Twitter@Zlatina_weather
Station type: PCE-FWS 20…Webcam link: View south to edge of Provadisko plateau
Post Reply