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

ec-forecast.php V6.00 released .. alerts are back!

Discussion of Ken True's web site templates

Moderator: saratogaWX

Post Reply
User avatar
saratogaWX
Posts: 1238
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

ec-forecast.php V6.00 released .. alerts are back!

Post by saratogaWX »

Rewrite complete! ec-forecast.php V6.01 - 26-Oct-2024 is now available.

The major change is to use a JSON feed instead of the (deprecated) citypage XML for the display -- the EC had dropped including alerts in the XML (so necessitating the rewrite).

The EC website no longer uses the city/page URLs, but has a new format with latitude,longitude. I've included code to use an existing lookup table, so all your existing city/page URLs should work fine (but may show slightly different locations due to lat,long fuzziness in the lookup).

OLD: $ECURL = 'hxxps://weather.gc.ca/city/pages/on-77_metric_e.html'; # Old format
NEW $ECURL = 'hxxps://weather.gc.ca/en/location/index.html?coords=43.258,-79.869'; # New Format

To add new sites, you'll need to use the new format URLs (but you don't need to change existing city/page URLs if they still display the forecast name for the location correctly).

The alerts (if any) are displayed as a mimic of the weather.gc.ca weather page -- a colored bar (color by type of alert) with the alert name.
Clicking on the left icon, warning text, or right icon will cause the details of the alert to display. Ended alerts are not displayed.
The $alertstring works the same as the old versions (empty if no alerts otherwise fully formatted HTML+JavaScript to display the alerts).

Template users can use the update tool with query Base-Canada,*-Plugin, 26-Oct-2024
Standalone users can use GitHub distribution or the script page to download.

Let me know any issues either by this topic or email using https://saratoga-weather.org/contact.php

Best regards,
Ken

Sample output (in French):
2024-10-26_ec-sample-1.png
Expanded Alert:
2024-10-26_ec-sample-2.png
You do not have the required permissions to view the files attached to this post.
User avatar
PaulMy
Posts: 4355
Joined: Sun 28 Sep 2008 11:54 pm
Weather Station: Davis VP2 Plus 24-Hour FARS
Operating System: Windows8 and Windows10
Location: Komoka, ON Canada
Contact:

Re: ec-forecast.php V6.00 released .. alerts are back!

Post by PaulMy »

Thanks Ken. I have updated, but looks like I must have missed something in the past as seems some conditions images are missing https://www.komokaweather.com/komokawea ... recast.php
I'll investigate further.

Enjoy,
Paul
VP2+
C1 www.komokaweather.com/komokaweather-ca
MX https://komokaweather.com/cumulusmx/index.htm /index.html /index.php
MX https://komokaweather.com/cumulusmxwll/index.htm /index.html /index.php
MX https:// komokaweather.com/cumulusmx4/index.htm
Image
User avatar
saratogaWX
Posts: 1238
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: ec-forecast.php V6.00 released .. alerts are back!

Post by saratogaWX »

Your main images are from:
https://www.komokaweather.com/komokawea ... ons/01.png

Your hourly images are from:
https://www.komokaweather.com/komokawea ... 10.png.png which if 404-not-found

https://www.komokaweather.com/komokawea ... /32p10.png is correct and does show.

try changing ec-forecast.php from

Code: Select all

$curicon = str_replace('.gif','',$icon);
to

Code: Select all

$curicon = str_replace('.gif','',$icon);
$curicon = str_replace('.png','',$curicon);
User avatar
PaulMy
Posts: 4355
Joined: Sun 28 Sep 2008 11:54 pm
Weather Station: Davis VP2 Plus 24-Hour FARS
Operating System: Windows8 and Windows10
Location: Komoka, ON Canada
Contact:

Re: ec-forecast.php V6.00 released .. alerts are back!

Post by PaulMy »

Bravo!
Thanks for looking and the quick reply Ken.

Enjoy,
Paul
VP2+
C1 www.komokaweather.com/komokaweather-ca
MX https://komokaweather.com/cumulusmx/index.htm /index.html /index.php
MX https://komokaweather.com/cumulusmxwll/index.htm /index.html /index.php
MX https:// komokaweather.com/cumulusmx4/index.htm
Image
User avatar
saratogaWX
Posts: 1238
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: ec-forecast.php V6.00 released .. alerts are back!

Post by saratogaWX »

Thanks for testing it...
I tried it on a local copy with .png icon type and it worked.. also with .gif, so I released ec-forecast.php V6.01 on the release channels and update tool.
Post Reply