Would anyone know if I could find an xml or some script to insert the weather forecast for the beach tabua de tides on my site?
I need something like this from this site:
Could you give me a help?
Would anyone know if I could find an xml or some script to insert the weather forecast for the beach tabua de tides on my site?
I need something like this from this site:
Could you give me a help?
The CPTEC website has some services in xml. link
I use a PHP code that connects to the link API, and step as parameters to the city in my case Araci-Bahia, the measure and the language, it returns a JSON after this is only you treat the JSON.
In my case I call this PHP via Ajax, there I do all the processing, iteration, etc.
function get_weather(){
try{
$obj = file_get_contents("http://api.openweathermap.org/data/2.5/weather?q=araci,brasil&lang=pt&units=metric");
$item = json_decode($obj);
//no meu caso dou a saída para o AJAX onde trato
return round($item->main->temp);
}catch(Exception $ex){
//trata o erro
}
}