Tides
- livejerseyweather
- Observer

- Posts: 13
- Joined: Sat Mar 09, 2019 5:56 pm
- Location: Jersey
- Station model: Davis Vantage Pro 2 Plus
- Software: Weather Display
- Contact:
Tides
Hi all
Not sure if anyone else has issues but it appears I no longer have data for the tide block I am getting a Data N/A on mine and looking at some of yours you appear to have the same? Any ideas?
Thanks
Ethan
Not sure if anyone else has issues but it appears I no longer have data for the tide block I am getting a Data N/A on mine and looking at some of yours you appear to have the same? Any ideas?
Thanks
Ethan
- meteocaldas
- Language Admin

- Posts: 111
- Joined: Fri Aug 25, 2017 7:56 pm
- Location: Caldas da Rainha, Portugal
- Station model: OS WMR-88A
- Software: Cumulus
- Contact:
Re: Tides
Same problem here
I have been cheking the link that the tidesBlock.php uses to parse tide times, and it seems ok, but... it has a different "look" from the page that they had when Jachym wrote the script.
This change in page layout is probably the reason why the script isn't working now.
The link to get the tide times is the one we have in settings.php and looks like:
$urlTides = 'https://www.tide-forecast.com/locations/{name of the location-name of country}/tides/latest';
If you put this link on your browser, it will return a valid page and tide times are ok for the referred location, so my conclusion is that the problem is not in the url itself.
I am not an expert and probably I am going to say something ridiculous at any expert eyes, but my idea is :
1- The $urlTides is read in xml and converted to the txt file named cacheTides.txt
2-This file is "parsed" and tide times are then extrated from it.
3- The script was written for a different XML layout and the problem is that current XML layout outputs a cacheTides.txt that can not be parsed with old script.
4 - Unfortunately this process uses XML that is much more difficult for me to understand, compared to a json process, so I am not able to understand how tide times are parsed. Sometimes it is just a matter of changing little things in the original script, but it requires a good knowledge on XML.
In other words, we are totally dependent of the good will of a XML expert to solve the problem

I have been cheking the link that the tidesBlock.php uses to parse tide times, and it seems ok, but... it has a different "look" from the page that they had when Jachym wrote the script.
This change in page layout is probably the reason why the script isn't working now.
The link to get the tide times is the one we have in settings.php and looks like:
$urlTides = 'https://www.tide-forecast.com/locations/{name of the location-name of country}/tides/latest';
If you put this link on your browser, it will return a valid page and tide times are ok for the referred location, so my conclusion is that the problem is not in the url itself.
I am not an expert and probably I am going to say something ridiculous at any expert eyes, but my idea is :
1- The $urlTides is read in xml and converted to the txt file named cacheTides.txt
2-This file is "parsed" and tide times are then extrated from it.
3- The script was written for a different XML layout and the problem is that current XML layout outputs a cacheTides.txt that can not be parsed with old script.
4 - Unfortunately this process uses XML that is much more difficult for me to understand, compared to a json process, so I am not able to understand how tide times are parsed. Sometimes it is just a matter of changing little things in the original script, but it requires a good knowledge on XML.
In other words, we are totally dependent of the good will of a XML expert to solve the problem
- Jachym
- Site Admin

- Posts: 1686
- Joined: Fri Aug 18, 2017 10:12 pm
- Location: Brno, Czech Republic
- Station model: WH1080
- Software: Meteobridge
- Contact:
Re: Tides
Hi guys,
I looked at the page and I had to delete both the block and the plugin. Even though the URL remained the same, the format of the page is completely different as well as Terms and conditions.
I was unable to find any free API that would provide similar data in a machine-readable format and this page is now copyrighted.
This is unfortunately what happens when you rely on third-party sites. I wish Meteotemplate was self-reliant and I never had to worry about something constantly changing, however this, given the page purpose, will never happen...
I looked at the page and I had to delete both the block and the plugin. Even though the URL remained the same, the format of the page is completely different as well as Terms and conditions.
I was unable to find any free API that would provide similar data in a machine-readable format and this page is now copyrighted.
This is unfortunately what happens when you rely on third-party sites. I wish Meteotemplate was self-reliant and I never had to worry about something constantly changing, however this, given the page purpose, will never happen...
- John B
- Forecaster

- Posts: 211
- Joined: Sun Aug 20, 2017 11:59 pm
- Location: Blaxland, N.S.W., Australia
- Station model: La Crosse WS2355
- Software: Weather Display
- Contact:
Re: Tides
Thanks, Jáchym, for investigating for us all, 'tis much appreciated, regardless of the disappointing outcome.
Cheers,
John
Cheers,
John