dakboard / Cloud-Platform

Feature requests, enhancements and anything you'd like to see in DAKboard!
https://dakboard.com
164 stars 39 forks source link

Change request weather alerts Wunderground API #91

Closed Arkoxs closed 5 years ago

Arkoxs commented 7 years ago

The weather alerts from the Wunderground API is not correctly displayed. The message is displayed but the end date is not processed, it just states "Until 1:00 on Jan 1, 1970"

Instead of just displaying the "message" field which contains an incorrect timeframe, I would suggest only displaying the "wtype_meteoalarm_name" field and the "date" and "expires" field.

This would change the message from: "Potential disruption due to extreme high temperatures from 12AM CEST THU until 11:59PM CEST THU Until 1:00 on Jan 1, 1970"

To: "Extreme high temperature from 2017-06-21 12:34:01 GMT until 2017-06-22 21:59:00 GMT"

This is the JSON received on an alert query on my location today, { "response": { "version":"0.1", "termsofService":"http://www.wunderground.com/weather/api/d/terms.html", "features": { "alerts": 1 } } ,"query_zone": "999", "alerts": [ { "type": "HEA", "wtype_meteoalarm": "5", "wtype_meteoalarm_name": "Extreme high temperature", "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": "Potential disruption due to extreme high temperatures from 12AM CEST THU until 11:59PM CEST THU", "date": "2017-06-21 12:34:01 GMT", "date_epoch": "NA", "expires": "2017-06-22 21:59:00 GMT", "expires_epoch": "NA", "message": "Potential disruption due to extreme high temperatures from 12AM CEST THU until 11:59PM CEST THU)", "phenomena": "NA", "significance": "NA", "attribution": "Information provided by , EUMETNET - MeteoAlarm Note: Time delays between this website and Meteoalarm.eu are possible. For the most up-to-date information about alert levels as published by the participating National Meteorological Services, please visit Meteoalarm. For terms of use of this information, and copyright information, see Meteoalarm Terms of Use." } ] }

dakboard commented 7 years ago

@Arkoxs, thanks for the suggestion. We are displaying the description field, and have updated the code to look at the expires field, if the expires_epoch field is blank (which it is in your case). This should fix the Jan 1, 1970 date you were seeing. If you see any other issues, please let us know! Thanks

himynamesned commented 7 years ago

Issue still apparent

dakboard commented 7 years ago

@himynamesned please let us know what you're using for your location and we can take a look. Thanks.

himynamesned commented 7 years ago

I was using "pws:IMESAYIT2" in the location. This then uses the exact station I wanted. image

Arkoxs commented 7 years ago

I have the same issue. No changes here.

Arko

Op di 25 jul. 2017 22:23 schreef himynamesned notifications@github.com:

I was using "pws:IMESAYIT2" in the location. This then uses the exact station I wanted. [image: image] https://user-images.githubusercontent.com/25020297/28591976-7bffb108-717f-11e7-9b9f-6cb951624456.jpg

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dannyk660/dakboard/issues/91#issuecomment-317860998, or mute the thread https://github.com/notifications/unsubscribe-auth/ADUHsGoH5Bn21YVxLrVEwz-6SQQtbhAtks5sRk7LgaJpZM4OA4bW .

danking6 commented 5 years ago

Phasing out WeatherUnderground as API keys are no longer available.