Created
June 22, 2015 13:30
-
-
Save xombra/9e538abbb0825a927c85 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# extraer la ubicacion (latitud y longitud) | |
# desde Google Maps | |
# | |
function CLIMA($latitud,$longitud) | |
{ $url = "http://api.openweathermap.org/data/2.5/weather?lat=$latitud&lon=$longitud&units=metric"; | |
# -------------------- | |
$clima = file_get_contents($url); | |
$json = json_decode($clima); | |
$temperatura = $json->main->temp; | |
# $temperaturamax = $json->main->temp_max; | |
# $temperaturamin = $json->main->temp_min; | |
# $presion = $json->main->pressure; | |
# $humedad = $json->main->humidity; | |
# $viento = $json->main->speed; | |
return $temperatura; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
<>