Giter VIP home page Giter VIP logo

appmeteo's Introduction

APPLICATION DE METEO

C'est une application qui permet de voir la meteo dans une ville.

Pour ce projet bien evidemment on a utilise du HTML et du CSS

On a utilise Open Weather Map comme API pour nous fournir les meteos des villes

Pour avoir access a l'api vous devez juste creer un compte et vous devez recuperer votre token

l' URL utilise doit être sous cette forme: https://api.openweathermap.org/data/2.5/weather?q=nom_de_la_ville&appid=votre_token&units=metric

Mais vu que l'on veut connaitre la ville de l'utilisateur au cas ou il active la localisation alors on utilise plus tot ce lien :

https://api.openweathermap.org/data/2.5/weather?lat=latitude&lon=longitude&appid=votre_token&units=metric

Cet API nous retourne un JSON avec beaucoup d'information mais on utilisera juste quelques ...

Ce code est un extrait de comment recuperer les informations grace a l'API

const url = " ... ";
let requete = new XMLHttpRequest();
requete.open("GET", url);
requete.responseType = "json";
requete.send();
requete.onload = function () {
  if (requete.readyState === XMLHttpRequest.DONE) {
    if (requete.status === 200) {
      let reponse = requete.response;
      let temperature = reponse.main.temp;
      let ville = reponse.name;
      let feels = reponse.main.feels_like;
      let humidity = reponse.main.humidity;
      let windSpeed = reponse.wind.speed;
    }
  }
};
  • temperature : c'est la temperature dans la ville
  • ville : c'est le nom de la ville
  • feels : c'est la temperature ressentie
  • humidity : c'est l'humidite
  • windSpeed : c'est la vitesse du vent

appmeteo's People

Contributors

ln-dev7 avatar la2spaille avatar billyjov avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.