I use a PHP code that connects to the API of http://openweathermap.org/,
and pass as parameters the city in my case Araci-Bahia, the measure and the language, it returns a JSON after that is only you treat the JSON.
In my case I call this PHP via Ajax, then I do all 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
}
}
You want to include the weather data, sea tablet seems to me the name of the beach only. You want to get that forecast data?
– Guilherme Nascimento
Hello @Guilhermenascimento guy I want to get only the data from the Tabua de Maré!
– Luciano Oliveira Lima
Hello Luciano, yes this is why I edited the question, to be clear, but unfortunately I did not find any API for this. It can only be in javascript or you use PHP, Rubyonrails or other server language?
– Guilherme Nascimento
Does Climatempo not have RSS of this? If you do, you can read the RSS. I think the INPE site has some XML services. Once you get XML, it’s easy to extract the information (using Scrapy, for example). If you don’t find it anywhere, you can extract it from HTML, although there is a risk that the site will change and your app will fail when it does.
– helderdarocha
https://github.com/raphaelVidinha/tabuaDeMare
– Derzu
https://github.com/LuisAraujo/API-Tabua-Mare
– Derzu