Warning: Invalid argument supplied for foreach() in /home/jihswbiz/public_html/t6.gwilt.org/refDox.php on line 212
Docs-getWeather

 

ReLoad

Keys


Functions

arraybrowsercolorcookiedatetimeDBdebugdeviceDSTequiverrorflagsfontformatgeo
holidayhtmlisjsonmathparsePHPprintsearchsortstringtabletexttracetype
VOTDweatherxml

Function  getWeather   Lines 259-279 (20 lines) file  utilsCoords.php   Last mod: Tue 2021-04-06 21:34:28

function getWeather $lat$lon$excl='minutely,hourly,alerts' )
        {
#-k     geo     weather
#-p     $lat    - req   - Latitude
#-p     $lon    - req   - Longtitude
#-p     $excl   - opt   - items to exclude; default 'minutely,hourly,alerts'

        
if ($lat[0] == "+"$lat substr($lat,1);
        
$weatherReq 'https://api.openweathermap.org/data/2.5/onecall?';
        
$api 'bd885445b285a9798b099d1ebcdc7e54';
        
$str =  'lat=' $lat .
                
'&lon=' $lon .
                
'&exclude=' $excl .
                
'&units=imperial' .
                
'&appid=' $api;

        
$a file_get_contents $weatherReq $str );
        
$w json_decode $atrue );
        return 
$w;
        }

?>