Bonjour
Bon, j'ai trouvé un service gratuit qui mets donc à dispo les infos météo ( et alertes ) selon la station choisie
S'enregistrer sur le site
https://www.wunderground.com/weather/api...lerts&MR=1 afin d'avoir une clé api.
Ensuite, une requete régulière nous retourne un json complet du style :
Code :
/ 20160611120103// http://api.wunderground.com/api/b8axxxxxxxxxxx1c/alerts/lang:FR/q/pws:ILENTILL2.json
{
"response": {
"version": "0.1",
"termsofService": "http://www.wunderground.com/weather/api/d/terms.html",
"features": {
"alerts": 1
}
},
"query_zone": "999",
"alerts": [
{
"type": "WRN",
"wtype_meteoalarm": "3",
"wtype_meteoalarm_name": "Thunderstorms",
"level_meteoalarm": "2",
"level_meteoalarm_name": "Yellow",
"level_meteoalarm_description": "The weather is potentially dangerous. The weather phenomena that have been forecast are not unusual, but be attentive if you intend to practice activities exposed to meteorological risks. Keep informed about the expected meteorological conditions and do not take any avoidable risk.",
"description": "\t\t\t\t\t\t\t\tfrançais: \n\t Des phénomènes habituels dans la région mais occasionnellement et localement dangereux sont prévus \n\t (ex. mistral, orage d’été, montée des eaux, fortes vagues submergeant le littoral) \n\t \n\t \n Soyez attentifs; si vous pratiquez des activitéssensibles au risque météorologique ou à proximité d'un rivage ou d'un cours d'eau; tenez-vous au courant de l’évolution de la situation. \n\t english: \n\t Although rather usual in this region, locally or potentially dangerous phenomena are expected. (such as local winds, summer thunderstorms, rising streams or high waves) \n\t \n\t \n Be aware and pay attention to the latest weather updates, especially if you carry out activities exposed to weather or close to a stream or shoreline.",
"date": "2016-06-11 09:32:00 GMT",
"date_epoch": "NA",
"expires": "2016-06-12 05:00:00 GMT",
"expires_epoch": "NA",
"message": "\t\t\t\t\t\t\t\tfrançais: \n\t Des phénomènes habituels dans la région mais occasionnellement et localement dangereux sont prévus \n\t (ex. mistral, orage d’été, montée des eaux, fortes vagues submergeant le littoral) \n\t \n\t \n Soyez attentifs; si vous pratiquez des activitéssensibles au risque météorologique ou à proximité d'un rivage ou d'un cours d'eau; tenez-vous au courant de l’évolution de la situation. \n\t english: \n\t Although rather usual in this region, locally or potentially dangerous phenomena are expected. (such as local winds, summer thunderstorms, rising streams or high waves) \n\t \n\t \n Be aware and pay attention to the latest weather updates, especially if you carry out activities exposed to weather or close to a stream or shoreline.)",
"phenomena": "NA",
"significance": "NA",
"attribution": "Information provided by , <a href='http://meteoalarm.eu/'>EUMETNET - MeteoAlarm</a> Note: Time delays between this website and <a href='http://meteoalarm.eu/'>Meteoalarm.eu</a> are possible. For the most up-to-date information about alert levels as published by the participating National Meteorological Services, please visit <a href='http://meteoalarm.eu/'>Meteoalarm</a>. For terms of use of this information, and copyright information, see <a href='http://meteoalarm.eu/'>Meteoalarm</a> Terms of Use."
}
]
}
On peut donc récupérer régulièrement le niveau d'alerte, sa couleur et le type d'alerte.
Philippe