Skip to content

Instantly share code, notes, and snippets.

@llaine
Created July 26, 2015 10:39
Show Gist options
  • Select an option

  • Save llaine/67ac1cf217966ffbad7d to your computer and use it in GitHub Desktop.

Select an option

Save llaine/67ac1cf217966ffbad7d to your computer and use it in GitHub Desktop.
Meteor france API

Récupérer l'ID de la ville correspondante.

var input = "Pessac"

http://www.meteofrance.com/mf3-rpc-portlet/rest/lieu/facet/pluie/search/input

Renvoie un truc du style :

[ {
  "id" : "333180",
  "onTheSnowSkiiId" : 0,
  "nomAffiche" : "Pessac (33600)",
  "type" : "VILLE_FRANCE",
  "slug" : "pessac",
  "codePostal" : "33600",
  "timezone" : "Europe/Paris",
  "altitude" : 37,
  "altitudeMin" : 0,
  "altitudeMax" : 0,
  "distance" : 0.0,
  "nbHabitants" : 58504,
  "lat" : 44.80509,
  "lon" : -0.633128,
  "directDisplay" : false,
  "nbView" : 0,
  "lastMareeDate" : null,
  "parent" : null,
  "positionAffichageCarteX" : 0,
  "positionAffichageCarteY" : 0,
  "value" : "Pessac (33600)",
  "pluieAvalaible" : true
}, {
  "id" : "333190",
  "onTheSnowSkiiId" : 0,
  "nomAffiche" : "Pessac-sur-Dordogne (33890)",
  "type" : "VILLE_FRANCE",
  "slug" : "pessac-sur-dordogne",
  "codePostal" : "33890",
  "timezone" : "Europe/Paris",
  "altitude" : 8,
  "altitudeMin" : 0,
  "altitudeMax" : 0,
  "distance" : 0.0,
  "nbHabitants" : 481,
  "lat" : 44.820136,
  "lon" : 0.077951,
  "directDisplay" : false,
  "nbView" : 0,
  "lastMareeDate" : null,
  "parent" : null,
  "positionAffichageCarteX" : 0,
  "positionAffichageCarteY" : 0,
  "value" : "Pessac-sur-Dordogne (33890)",
  "pluieAvalaible" : true
} ]

Récupérer la meteor à une heure.

Puis à partir de l'id récupéré.

GET / http://www.meteofrance.com/mf3-rpc-portlet/rest/pluie/330630

Renvoie qqchose ayant cette tête la.

{
  "idLieu" : "330630",
  "echeance" : "201507261235",
  "lastUpdate" : "12h25",
  "isAvailable" : true,
  "hasData" : true,
  "niveauPluieText" : [ "De12h35 à 13h35 : Pas de précipitations" ],
  "dataCadran" : [ {
    "niveauPluieText" : "Pas de précipitations",
    "niveauPluie" : 1,
    "color" : "ffffff"
  }, {
    "niveauPluieText" : "Pas de précipitations",
    "niveauPluie" : 1,
    "color" : "ffffff"
  }, {
    "niveauPluieText" : "Pas de précipitations",
    "niveauPluie" : 1,
    "color" : "ffffff"
  }, {
    "niveauPluieText" : "Pas de précipitations",
    "niveauPluie" : 1,
    "color" : "ffffff"
  }, {
    "niveauPluieText" : "Pas de précipitations",
    "niveauPluie" : 1,
    "color" : "ffffff"
  }, {
    "niveauPluieText" : "Pas de précipitations",
    "niveauPluie" : 1,
    "color" : "ffffff"
  }, {
    "niveauPluieText" : "Pas de précipitations",
    "niveauPluie" : 1,
    "color" : "ffffff"
  }, {
    "niveauPluieText" : "Pas de précipitations",
    "niveauPluie" : 1,
    "color" : "ffffff"
  }, {
    "niveauPluieText" : "Pas de précipitations",
    "niveauPluie" : 1,
    "color" : "ffffff"
  }, {
    "niveauPluieText" : "Pas de précipitations",
    "niveauPluie" : 1,
    "color" : "ffffff"
  }, {
    "niveauPluieText" : "Pas de précipitations",
    "niveauPluie" : 1,
    "color" : "ffffff"
  }, {
    "niveauPluieText" : "Pas de précipitations",
    "niveauPluie" : 1,
    "color" : "ffffff"
  } ]
}

Les

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment