Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change request weather alerts Wunderground API #91

Closed
Arkoxs opened this issue Jun 21, 2017 · 6 comments
Closed

Change request weather alerts Wunderground API #91

Arkoxs opened this issue Jun 21, 2017 · 6 comments

Comments

@Arkoxs
Copy link
Contributor

Arkoxs commented Jun 21, 2017

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
Copy link
Collaborator

@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
Copy link

Issue still apparent

@dakboard
Copy link
Collaborator

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

@dakboard dakboard reopened this Jul 25, 2017
@himynamesned
Copy link

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

@Arkoxs
Copy link
Contributor Author

Arkoxs commented Jul 25, 2017 via email

@danking6
Copy link
Member

Phasing out WeatherUnderground as API keys are no longer available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants