Author Topic: Saratoga script updates - 22-Feb-2017 for cURL+HTTPS access...  (Read 753 times)

saratogaWX

  • Strong Breeze
  • ***
  • Posts: 118
  • Weather website programming enthusiast
    • Saratoga-Weather.org
  • Station Details: Davis VP1 +, iMAC 21, OSX 10.6.8
Saratoga script updates - 22-Feb-2017 for cURL+HTTPS access...
« on: February 22, 2017, 09:32:00 PM »
I've been doing some updates to scripts to use the cURL function to retrieve data, access source websites using HTTPS (where available) and improving the debugging output (in HTML comments) on four scripts used both standalone and in the Saratoga templates:

USA:
The radar-status.php script was updated to V1.15 and fixed a nagging issue that showed a negative updated time when a fresh load from http://radar3pub.ncep.noaa.gov/ was done.  The negative time was due to two things:
1) the page didn't include a Last-modified: header and
2) the Status as of time was generally earlier than some of the entries in the table.
That was fixed by fetching their SHTML included file instead, and that has a Last-modified header so there are no more negative times.  The script is also ready for when they (eventually) swap to HTTPS only for access in the future.
Standalone: update from the script page
Saratoga template: update from the update tool page with query of Base-USA, Plugin-*, 22-Feb-2017

Canada:
Both the ec-radar.php V2.02 and ec-forecast.php V4.02 were updated to use HTTPS to the EC website and have improved debugging outputs as HTML comments.
ec-radar.php now just returns to the calling page and has HTML debug output as comments instead of stopping all page generation (used return; instead of exit; D'Oh).
ec-forecast.php included a fix for some missing Yesterday output in the conditions area caused by (yet another) EC website structure change.  I checked out the XML feed from the EC and it still doesn't include icons for the conditions, so we'll be stuck with page-scraping a bit longer.  Sigh..
Standalone: update ec-forecast.php from the script page
Standalone: update ec-radar.php from the script page
Saratoga template: update both from the update tool page with query of Base-Canada, Plugin-*, 22-Feb-2017

World:
The WU-forecast.php V3.03 has the new cURL-based fetch to the WU API and uses HTTPS to access the WU API website along with some improved debugging diagnostic outputs as HTML comments.
Standalone: update from the script page
Saratoga template: update from the update tool page with query of Base-World, Plugin-*, 22-Feb-2017

There will be other scripts updated that use the old fetchUrlWithoutHanging() function to replace it with the new HTTPS-capable version. 

Best regards,
Ken


Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis Vantage Pro Plus - FARS, Boltek-PCI/NexStorm, GRLevel3, WD, WL, VWS, Cumulus, Meteohub, WeatherSnoop, WeatherCat
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP