Weather to include on the site

Asked

Viewed 3,259 times

4

Someone would know me informs me where could find an xml or some script to insert the forecast of the beach Climatempo tidal tablet on my website?

I need something like this site:

http://www.climatempo.com.br/tabua-de-mares/

Could you give me a hand?

  • 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?

  • Hello @Guilhermenascimento guy I want to get only the data from the Tabua de Maré!

  • 1

    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?

  • 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.

  • https://github.com/raphaelVidinha/tabuaDeMare

  • https://github.com/LuisAraujo/API-Tabua-Mare

Show 1 more comment

2 answers

4

  • I made an Application using the API - XML of this site here (http://developers.agenciaideias.com.br/) it has the information without Json tbem if you prefer

  • Very good, I did it with the API of this site http://openweathermap.org/api I did it in Json and in an XML it has a lot of other information. This site has beyond weather, UV index, Air Pollution, weather station data ... very good Just like Matheus said below

2

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
 }
}
  • I didn’t find the tidal plank part in this Openweathermap, can you let me know if you have?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.