Page 1 of 1

quake-json V3.00 available - plate/fault maps added

Posted: Thu 14 Nov 2019 3:45 pm
by saratogaWX
I've finished adding tectonic plate and fault maps display (along with two new free maps: NatGeo and Delorme) to quake-json scripts V3.00 -13-Nov-2019

Standalone users: download the .zip file or use the GitHub distribution
Saratoga template users: Use the update tool page with a query of Base-*, *-Plugin, 13-Nov-2019

The script now includes 3 USGS fault displays, one Phillippines display, two Worldwide displays, and one UK-BGS display.
The plate display is from the USGS.

See the attached for sample image outputs.

Best regards,
Ken

Re: quake-json V3.00 available - plate/fault maps added

Posted: Tue 26 May 2020 3:56 am
by BeaumarisWX
Hi Ken,
Thanks as always, (hope you are well).
Just curious the "./cache/quakesjson.txt " does not get created and on every page load "quake-json.php" downloads new data.
Maybe I have missed something. https://beaumaris-weather.com/quakes.php
Kind Regards,

Re: quake-json V3.00 available - plate/fault maps added

Posted: Tue 26 May 2020 5:17 am
by saratogaWX
Still healthy, thanks to shelter-in-place since mid March.. thanks for asking :)

It looks like there is no ./cache/ directory, or it is not writable by PHP so cache/quakesjson.txt gets a 404-Not Found.

The ./cache/ directory should have permissions of 0755 on a *nix webserver.

If the cache file can't be found/loaded, it fetches the data from the USGS and attempts to save that data in the cache.

Re: quake-json V3.00 available - plate/fault maps added

Posted: Tue 26 May 2020 6:58 am
by BeaumarisWX
Hi Ken,
Well that good news, make sure you stay that way.
Well I am a aloss matey, the ./cache/ folder does exist and I have many other scripts caching to it (it is 0755).
I also noticed say Simon's site for instance seems not to cache either.

example : https://www.conligwx.org/cache/quakesjson.txt and https://www.conligwx.org/quakesjson.txt

also :

https://vinesweather.com/cache/quakesjson.txt and https://vinesweather.com/quakesjson.txt

Looking at the last updated times of all these cached files I'm wondering if they relate to upgrades and also possibly because the pages generally load ok even though not caching, that it's just not been picked up before.

Has me baffled.
Kind Regards,

Re: quake-json V3.00 available - plate/fault maps added

Posted: Tue 26 May 2020 4:36 pm
by saratogaWX
I think I've found the issue .. it's the HTTP/2 return code.

Try changing quake-json.php

Code: Select all

	  if(!preg_match('|200 |',$RC)) {
to

Code: Select all

	  if(!preg_match('|200|',$RC)) {
(removing the space after 200 above).

HTTP/1 responses are like '200 Ok'. HTTP/2 responses are just the code '200'.

Re: quake-json V3.01 available - fix for cache issue

Posted: Tue 26 May 2020 5:05 pm
by saratogaWX
I've updated the script in the Template, Standalone and GitHub distributions with that fix

quake-json.php V3.01 - 26-May-2020

Thanks for spotting the issue.. some sites get HTTP/1 returns (like mine), while others get HTTP/2 returns (and fail with the V3.00 script).
This update handles both HTTP/1 and HTTP/2 return from the USGS website.

Re: quake-json V3.00 available - plate/fault maps added

Posted: Tue 26 May 2020 11:23 pm
by BeaumarisWX
Hi Ken,
As always you are a legend matey, I would not have found that though I knew something was astray.
Cache now works a treat, thank you. https://beaumaris-weather.com/quake-json.php - https://beaumaris-weather.com/wxquake.php

Also love the new wxstatus addition, I awoke just now and checked it to see following :D (hello Ken's found a fix) it was so gratifying.
QuakesJsonFix.PNG
Kindest Regards,

Re: quake-json V3.00 available - plate/fault maps added

Posted: Tue 26 May 2020 11:41 pm
by saratogaWX
Thanks for the kind words! :D

I decided to add the version checking to wxstatus.php since many of the 'it's broken' comments/questions seem to come from folks who don't regularly do a check-fetch-times.php?show=versions on their site before asking the question ...

Many folks do check the wxstatus.php page (I keep mine up ALL the time since there's lots of background processes to keep watch over). Adding the magic box at the end of the wxstatus.php page gives a helpful nudge to have the software remain current (and thereby, hopefully avoid issues as the source website URLs and/or PHP versions update).

As an aside, I'd fixed that issue with other scripts before, I'd just not gotten around to fixing it in quake-json.php since I'd not seen the issue and it hadn't been reported.
So... thanks for reporting it!

Best regards, and stay healthy!
Ken