After several months of testing/tweaking, the get-USNO-sunmoon.php script has been revised to V3.00.
The major changes are:
1) switch to using curl to access api.usno.navy.mil API (better timeout control) and
2) addition of built-in calculations to supply sun/moon rise/set and moon %illumination and phase (thanks to Jachym and others for sharing the code!)
You can add a new setting to Settings.php where you can optionally switch the script from using the USNO to using the internal calculations.
$SITE['useUSNO'] = true; // =true; default -- use the USNO api.usno.navy.mil JSON for data
$SITE['useUSNO'] = false; // =false: use the internal calculations and no access to the USNO api.usno.navy.mil server
Note that the internal calculations are within a couple of minutes of the more-accurate USNO data, and likewise the % illumination is within a couple percent. For best accuracy, continue to use the USNO. If the USNO server has issues, then switch to using the internal calculations to free your website page load from externally caused delays with the USNO server.
Standalone download
hereSaratoga template: use the
update tool (Base-*, Plugin-*, 11-Oct-2017)
(note that get-metar-conditions-inc.php V1.16 is included in the update, and for USA templates, advforecast2.php V5.04 (JSON) is included)
Best regards,
Ken