Author Topic: Standard Saratoga template UK quakes [Resolved]  (Read 1520 times)

0 Members and 1 Guest are viewing this topic.

Offline Vasco

  • Forecaster
  • *****
  • Posts: 343
    • PWS
Standard Saratoga template UK quakes [Resolved]
« on: July 15, 2023, 10:39:03 AM »
For all scripts using cURL I have to add a line for a proxy server:

Code: [Select]
curl_setopt($ch, CURLOPT_PROXY, 'IPaddress:3128');
Can anyone tell me how to do the same for fsockopen in quake-UK.php?

« Last Edit: July 15, 2023, 12:35:06 PM by Vasco »
Ecowitt GW1102 (with GW2000) + Weather Display in Windows 10

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9298
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Standard Saratoga template UK quakes
« Reply #1 on: July 15, 2023, 11:29:31 AM »
Wow, that is an ancient script (last update August, 2011).  It was time I updated it to use curl.

Download from https://saratoga-weather.org/wxtemplates/World/quake-UK.php?sce=view
the shiny new update.

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Vasco

  • Forecaster
  • *****
  • Posts: 343
    • PWS
Re: Standard Saratoga template UK quakes
« Reply #2 on: July 15, 2023, 11:40:31 AM »
Wow, that is an ancient script (last update August, 2011).  It was time I updated it to use curl.

That's what my ISP said when he refused to tell me how to do it: he said "why re-invent the wheel?"  :grin:

Quote
Download . . .the shiny new update.

Thanks, Ken. I'll report back. . .
« Last Edit: July 15, 2023, 01:30:32 PM by Vasco »
Ecowitt GW1102 (with GW2000) + Weather Display in Windows 10

Offline Vasco

  • Forecaster
  • *****
  • Posts: 343
    • PWS
Re: Standard Saratoga template UK quakes
« Reply #3 on: July 15, 2023, 11:55:31 AM »
Thanks, Ken. I'll report back. . .

Fantastic  :grin:

One little query: am I missing an icon at the foot of the page?
Ecowitt GW1102 (with GW2000) + Weather Display in Windows 10

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9298
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Standard Saratoga template UK quakes
« Reply #4 on: July 15, 2023, 12:16:58 PM »
The quake-UK.php doesn't produce any image links.. it's output ends with the "All rights Reserved."
That second link is likely on the including page.

Yep.. in wxquakeUK.php, it's
Code: [Select]
<p style="align: center"><a href="http://www.earthquakes.bgs.ac.uk/"><img src="http://www.earthquakes.bgs.ac.uk/uk.jpg.0" alt="Recent Earthquake Events"
  width="338" height="520" style="border: none;"/></a></p>
they are producing the strangely named image, but only in http.  So if your site is https, it won't display due to browser rules about mixed https/http content.
« Last Edit: July 15, 2023, 12:27:08 PM by saratogaWX »
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Vasco

  • Forecaster
  • *****
  • Posts: 343
    • PWS
Re: Standard Saratoga template UK quakes
« Reply #5 on: July 15, 2023, 12:26:14 PM »
The quake-UK.php doesn't produce any image links.. it's output ends with the "All rights Reserved."
That second link is likely on the including page.

Yep.. in wxquakeUK.php, just delete
Code: [Select]
<p style="align: center"><a href="http://www.earthquakes.bgs.ac.uk/"><img src="http://www.earthquakes.bgs.ac.uk/uk.jpg.0" alt="Recent Earthquake Events"
  width="338" height="520" style="border: none;"/></a></p>
they no longer appear to be producing the image on the BGS site.

Yes, I found it  :-)

Thanks, Ken  :grin:
Ecowitt GW1102 (with GW2000) + Weather Display in Windows 10

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9298
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Standard Saratoga template UK quakes [Resolved]
« Reply #6 on: July 15, 2023, 12:37:51 PM »
Ahh.  Due to a foible with their cert, you can use https://earthquakes.bgs.ac.uk/uk.jpg.0 as the image link, but not the one with www. in front.

use
Code: [Select]
<p style="align: center"><a href="https://earthquakes.bgs.ac.uk/"><img src="https://earthquakes.bgs.ac.uk/uk.jpg.0" alt="Recent Earthquake Events"
  style="border: none;"/></a></p>

instead.
« Last Edit: July 15, 2023, 12:50:29 PM by saratogaWX »
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Vasco

  • Forecaster
  • *****
  • Posts: 343
    • PWS
Re: Standard Saratoga template UK quakes [Resolved]
« Reply #7 on: July 15, 2023, 12:50:28 PM »
Ahh.  Due to a foible with their cert, you can use https://earthquakes.bgs.ac.uk/uk.jpg.0 as the image link, but not the one with www. in front.

Gotcha  :grin:

I might just experiment to get that at the top of the page. . .  ;)
Ecowitt GW1102 (with GW2000) + Weather Display in Windows 10

Offline Vasco

  • Forecaster
  • *****
  • Posts: 343
    • PWS
Re: Standard Saratoga template UK quakes [Resolved]
« Reply #8 on: July 15, 2023, 05:15:17 PM »
Currently, for each entry, link for epicentre (line 339) and map (line 343) are the same - $url, defined in line 299:

Code: [Select]
$url = $baseURL . $link;
Suggestion: define $url2

Code: [Select]
$url2= $url."#page=maps";
in line 300 and change map line (now 344) to

Code: [Select]
<td align=\"center\"><a href=\"$url2\">Map</a></td>
Seems to work  :-)
« Last Edit: July 15, 2023, 05:18:25 PM by Vasco »
Ecowitt GW1102 (with GW2000) + Weather Display in Windows 10

Offline hcorrin

  • Contributor
  • ***
  • Posts: 136
    • Ballaugh Weather
Re: Standard Saratoga template UK quakes [Resolved]
« Reply #9 on: July 16, 2023, 06:38:43 PM »
i tried those alterations but it still defaults to summary page   https://www.hc-iom.co.uk/WD-AJAX3/wxquakeUK.php

Offline Vasco

  • Forecaster
  • *****
  • Posts: 343
    • PWS
Re: Standard Saratoga template UK quakes [Resolved]
« Reply #10 on: July 16, 2023, 07:10:25 PM »
i tried those alterations but it still defaults to summary page   https://www.hc-iom.co.uk/WD-AJAX3/wxquakeUK.php

I just tried your page. Epicentre link went to Summary but Map link went to Maps. . .  :???:
Ecowitt GW1102 (with GW2000) + Weather Display in Windows 10

Offline hcorrin

  • Contributor
  • ***
  • Posts: 136
    • Ballaugh Weather
Re: Standard Saratoga template UK quakes [Resolved]
« Reply #11 on: July 17, 2023, 04:20:11 AM »
Ah strangely had not noticed the map link on the right but yes does work
Thanks

Offline Vasco

  • Forecaster
  • *****
  • Posts: 343
    • PWS
Re: Standard Saratoga template UK quakes [Resolved]
« Reply #12 on: July 17, 2023, 09:36:08 AM »
. . . but yes does work

:grin:

I've done the same with world earthquakes, too. Around line 703 of quake-json.php add a line to define $mapURL2:

Code: [Select]
// load local variables
$mapURL  = $onequake['properties']['url'];
$mapURL2 = $mapURL.'/map';

Then change $mapURL to $mapURL2 in line 803, so it reads:

Code: [Select]
  <td align=\"center\"><a href=\"$mapURL2\"$tgt>".langtransstr('map')."</a></td>

I know it only saves one click on the /executive page to get the /map, but I do like a map link to go straight to a map  :-)
Ecowitt GW1102 (with GW2000) + Weather Display in Windows 10

Offline Vasco

  • Forecaster
  • *****
  • Posts: 343
    • PWS
Re: Standard Saratoga template UK quakes [Resolved]
« Reply #13 on: December 12, 2023, 12:01:52 PM »
Ahh.  Due to a foible with their cert, you can use https://earthquakes.bgs.ac.uk/uk.jpg.0 as the image link, but not the one with www. in front.

Think something similar is now happening with the links to summary/map in the actual list of earthquakes: links come up as, e.g., https://www.quakes.bgs.ac.uk/earthquakes/recent_events/20231211112629.html#page=summary

I get a "Privacy error" in Chrome and Edge until I manually delete the www.  :???:

Still works in Safari  :-)
« Last Edit: December 12, 2023, 02:42:00 PM by Vasco »
Ecowitt GW1102 (with GW2000) + Weather Display in Windows 10

Offline hcorrin

  • Contributor
  • ***
  • Posts: 136
    • Ballaugh Weather
Re: Standard Saratoga template UK quakes [Resolved]
« Reply #14 on: December 12, 2023, 06:07:46 PM »
that site appears to be still using http not https
when i tried chrome it automatically removed the www and is the latest version of chrome the www still shows in my version of edge and still works ok edge updated last night

Offline Vasco

  • Forecaster
  • *****
  • Posts: 343
    • PWS
Re: Standard Saratoga template UK quakes [Resolved]
« Reply #15 on: December 12, 2023, 07:06:55 PM »
Chrome and Edge both up to date and still doesn't work for me. . .  :sad:
Ecowitt GW1102 (with GW2000) + Weather Display in Windows 10

Offline Vasco

  • Forecaster
  • *****
  • Posts: 343
    • PWS
Re: Standard Saratoga template UK quakes [Resolved]
« Reply #16 on: December 13, 2023, 02:32:29 PM »
Think I've cracked it  :-)

Despite dire warnings I edited lines 96-7 of quake-UK.php from

Code: [Select]
  $baseURL  = "http://www.quakes.bgs.ac.uk";  //BGS website (omit trailing slash)
  $fileName = "http://www.quakes.bgs.ac.uk/earthquakes/recent_uk_events.html";

to

Code: [Select]
  $baseURL  = "http://quakes.bgs.ac.uk";  //BGS website (omit trailing slash)
  $fileName = "http://quakes.bgs.ac.uk/earthquakes/recent_uk_events.html";

Seems to work :grin:

BTW: think there's a typo in line 60:

Code: [Select]
//  parms:    include("http://your.website/quake-UK.php?tableonly=Y&magnitude=2.0&distance=50");
should read

Code: [Select]
//  parms:    include("http://your.website/quake-UK.php?tablesonly=Y&magnitude=2.0&distance=50");
and the default period now seems to be 60 days, not 50.
« Last Edit: December 14, 2023, 03:04:39 PM by Vasco »
Ecowitt GW1102 (with GW2000) + Weather Display in Windows 10

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9298
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Standard Saratoga template UK quakes [Resolved]
« Reply #17 on: December 14, 2023, 03:29:21 PM »
Your change of the URLs is a good one (given the BGS website updated config), so thanks for your keen eyes and sleuthing out the fix!

The BTW is not quite correct.. the &distance=50 in the comment refers to the distance from your site to the epicenter, not to the number of days displayed .. the script displays all that the BGS returns.
« Last Edit: December 14, 2023, 03:31:03 PM by saratogaWX »
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Vasco

  • Forecaster
  • *****
  • Posts: 343
    • PWS
Re: Standard Saratoga template UK quakes [Resolved]
« Reply #18 on: December 14, 2023, 04:34:15 PM »
The BTW is not quite correct.. the &distance=50 in the comment refers to the distance from your site to the epicenter, not to the number of days displayed .. the script displays all that the BGS returns.

No, I wasn't referring to the distance but the header and footer: file now contains last 60 days  ;)

The comment was just about ?tableonly vs ?tablesonly  :-)
« Last Edit: December 14, 2023, 04:38:10 PM by Vasco »
Ecowitt GW1102 (with GW2000) + Weather Display in Windows 10

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9298
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Standard Saratoga template UK quakes [Resolved]
« Reply #19 on: December 14, 2023, 04:55:48 PM »
Ahh.. sorry, I'd conflated the 50 with the 50 in the comment URL.. I understand now.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

 

anything