Page 1 of 1

Tides block stopped working

Posted: Sat Jul 07, 2018 5:27 pm
by Alexandros
For some reason it is almost a week that Tides_1.2 block stopped working and in its place Data N/A is only shown. I checked the related url in https://www.tide-forecast.com to see if their server is down but their site is working fine for my chosen location. So I guess that the process of decoding and stripping their data in the php meteotemplate tidesBlock file should be amended to probably include any changes that tide-forecast might have done in their page.

Any help on above?

Re: Tides block stopped working

Posted: Sat Jul 07, 2018 9:32 pm
by hcorrin
Hi
just checked mine and I have the same but a cache file is created but the data in it is different to an older file I have on a backup
I also notice the plugin is giving the same error probably for the same reason

Re: Tides block stopped working

Posted: Mon Jul 09, 2018 3:34 am
by LOBWX
Same here - Data N/A

Re: Tides block stopped working

Posted: Mon Jul 09, 2018 9:14 am
by meteocaldas
Same here Data N/A.
TidesCache.txt is beeing created and updated but it looks like they have redesigned their html page and parsing data from there is not giving any results because their html code is somewhat different now.
I have been trying to fix the issue but my knowledge is too short for that and the result is always the same: no results :-)
Help, pleaseeee!
I had never imagined that there were so many fishermen visiting my site just looking for local beach weather, tides and moons :-)

http://www.meteocaldas.com/mtp
Image

Re: Tides block stopped working

Posted: Wed Jul 11, 2018 7:45 am
by stewart45
Same here, been down for a week now

Re: Tides block stopped working

Posted: Wed Jul 11, 2018 8:33 pm
by Asobig
I think i figured out what changed in the html of the Tide-forcast website:
Do the following:

In tidesBlock.php change line 55 from:

Code: Select all

preg_match('/<h1 class="tab">Tide Times for (.*?)<\/h1>/',$html,$matchesPlace);
to:

Code: Select all

preg_match('/<h1 class="title is-4 has-text-primary has-text-centered">Tide Times for (.*?)<\/h1>/',$html,$matchesPlace);
Change line 71 from:

Code: Select all

preg_match('/\<section class="tide-events not_in_print"\>(.*)?\<\/section\>/',$html,$matches);
to:

Code: Select all

preg_match('/\<section class="section tides-content-table tide-events not_in_print is-imperial" >(.*)?\<\/section\>/',$html,$matches);
Change line 80 from:

Code: Select all

$explodeDays = explode('<td class="date"',$predictionDiv);
to:

Code: Select all

$explodeDays = explode('<th class="date "',$predictionDiv);
Change line 84 from:

Code: Select all

preg_match('/rowspan="[0-9]">(.*?)<\/td>(.*?)$/',$explodeDays[$i],$matches);
to:

Code: Select all

preg_match('/rowspan="[0-9]" >(.*?)<\/th>(.*?)$/',$explodeDays[$i],$matches);
Then the block is working again.

Re: Tides block stopped working

Posted: Thu Jul 12, 2018 3:11 am
by John B
Thanks, Asobig, there's a bucket of salt water heading your way. ;)

It surely works for me.

Regards,
John

Re: Tides block stopped working

Posted: Thu Jul 12, 2018 7:44 am
by stewart45
well done that man

Re: Tides block stopped working

Posted: Thu Jul 12, 2018 8:39 am
by xl1954
Hello all

After the correction from Absoblg, all is running.

Thanks a lot

Re: Tides block stopped working

Posted: Thu Jul 12, 2018 1:52 pm
by Gus
Followed Absobig's instructions and all is well. Had to make one change in line 71.
I had to change new line 71 from tide-events not_in_print is-imperial to tide-events not_in_print is-metric. This dependings what https://www.tide-forecast.com does not show as height, meters or feet.

preg_match('/\<section class="section tides-content-table tide-events not_in_print is-imperial" >(.*)?\<\/section\>/',$html,$matches);
- OR -
preg_match('/\<section class="section tides-content-table tide-events not_in_print is-metric" >(.*)?\<\/section\>/',$html,$matches);

Tide plugin can also be fixed by applying changes to ...
line 69
line 85
line 94
line 98
https://www.halethorpeweather.com/meteo ... /index.php

Thanks,
Gus

Re: Tides block stopped working

Posted: Thu Jul 12, 2018 6:38 pm
by meteocaldas
Asobig wrote: Wed Jul 11, 2018 8:33 pm I think i figured out what changed in the html of the Tide-forcast website:
Do the following:.....
Then the block is working again.
Hi Asobig,
Thank you sooooo much!
Tide block is working perfectly again, and now all the fishermen in my area will be thanking you too :-)

http://www.meteocaldas.com/mtp
Image

Re: Tides block stopped working

Posted: Thu Jul 12, 2018 11:15 pm
by LOBWX
For the life of me I can't get this block to work again? I installed the 1.3 block that was just updated in the blocks section http://www.meteotemplate.com/web/blocks.php

The block is caching the data from https://www.tide-forecast.com/locations ... des/latest

Im stumped???

Re: Tides block stopped working

Posted: Fri Jul 13, 2018 2:02 am
by BlueBear
In case you hadn't noticed, your tide plugin isn't working either!!!
Neither is mine :(

Re: Tides block stopped working

Posted: Fri Jul 13, 2018 3:05 am
by LOBWX
I tried what Gus had posted but still the Block nor the Plugin are working :?:

Re: Tides block stopped working

Posted: Fri Jul 13, 2018 3:41 pm
by Alexandros
All is fine again. Asobig, thank you for your effort and especially your time.

Re: Tides block stopped working

Posted: Fri Jul 13, 2018 6:23 pm
by dtwrlewis
This worked for me

Thanks

Gus wrote: Thu Jul 12, 2018 1:52 pm Followed Absobig's instructions and all is well. Had to make one change in line 71.
I had to change new line 71 from tide-events not_in_print is-imperial to tide-events not_in_print is-metric. This dependings what https://www.tide-forecast.com does not show as height, meters or feet.

preg_match('/\<section class="section tides-content-table tide-events not_in_print is-imperial" >(.*)?\<\/section\>/',$html,$matches);
- OR -
preg_match('/\<section class="section tides-content-table tide-events not_in_print is-metric" >(.*)?\<\/section\>/',$html,$matches);

Tide plugin can also be fixed by applying changes to ...
line 69
line 85
line 94
line 98
https://www.halethorpeweather.com/meteo ... /index.php

Thanks,
Gus

Re: Tides block stopped working

Posted: Sat Jul 14, 2018 1:56 am
by LOBWX
So I have tried to get this Tides Block to work again on two different servers with absolutely no luck. One is my paid hosted server and the other is on my PI3B+.

If someone would not mind posting their entire working tidesBlock.php here so I could try using it to rule out any syntax errors on my part. I would appreciate it.

Nevermind I got it to work again

~Bob~

Re: Tides block stopped working

Posted: Tue Jul 17, 2018 9:39 pm
by hcorrin
the block is working ok for me after the update, but when I tried the changes in the plugin, the page loads but no graph or data is showing and if metric is used instead of imperial I get data N/A

http://www.hc-iom.co.uk/template/plugin ... /index.php

Re: Tides block stopped working

Posted: Thu Dec 06, 2018 2:19 pm
by dtwrlewis
Data not available again.

Have they changed their formatting again?Anyone else having this problem?

Re: Tides block stopped working

Posted: Thu Dec 06, 2018 10:29 pm
by John B
All fine here (Thu. 2018-12-06 22:30 UTC).

Re: Tides block stopped working

Posted: Mon Oct 07, 2019 6:31 pm
by livejerseyweather
I think the formatting has changed again as all appears to be offline. Any ideas anyone?

Re: Tides block stopped working

Posted: Wed Oct 09, 2019 11:51 am
by stewart45
same problem here