Pirate-Weather / pirateweather

Code and documentation for the Pirate Weather API
Apache License 2.0
670 stars 29 forks source link

National Weather Service alert record URLs no longer valid #159

Closed ChrisHardie closed 7 months ago

ChrisHardie commented 9 months ago

Describe the bug

When receiving a forecast response that contains an "alerts" component, the uri returned is no longer a valid link to a weather.gov weather alert.

Expected behavior

For example, in requesting the weather just now for Reno, Nevada, USA, I saw this part of the API response:

"alerts": [
        {
            "title": "Wind Advisory issued February 24 at 1:17PM PST until February 27 at 4:00AM PST by NWS Reno NV",
            "regions": [
                "Greater Reno-Carson City-Minden Area"
            ],
            "severity": "Moderate",
            "time": 1708970400,
            "expires": 1709035200,
            "description": "* WHAT...Southwest winds 25 to 35 mph with gusts up to 50 mph. Winds gusting as high as 65 mph for wind prone areas including areas along US-395 in the North Valleys and I-580 in Washoe Valley.  * WHERE...Greater Reno-Carson City-Minden Area.  * WHEN...From 10 AM Monday to 4 AM PST Tuesday.  * IMPACTS...Gusty winds will blow around unsecured objects and make travel difficult, especially for high profile vehicles. Tree limbs could be blown down and a few power outages may result.",
            "uri": "https://alerts-v2.weather.gov/#/?id=urn%3Aoid%3A2.49.0.1.840.0.f8805a851bf8b9cb8dd4ad78b004a062b3b574bb.003.1"
        }
    ],

but visiting that URI https://alerts-v2.weather.gov/#/?id=urn%3Aoid%3A2.49.0.1.840.0.f8805a851bf8b9cb8dd4ad78b004a062b3b574bb.003.1 just pulls up a generic landing page that allows the user to search for weather alerts, instead of to the expected weather alert. Previously these links worked as expected. Replacing the URL encoding to use ...urn:oid:2.49... does not help.

Screenshot 2024-02-24 at 19 55 45

Actual behavior

A landing page for searching for alerts is loaded instead of the the actual alert page.

API Endpoint

Production

Location

39.530895,-119.814972

Other details

This appears to be the result of a redesign of the NWS web interface to a UX that does not support the use of distinct URLs to view individual weather alerts. I can search for an alert by ID or location and view it, but there's no permalink back to that view that I've found. Talk about a step backward! But maybe there's an alternative interface I'm not aware of. The closest I can find is this kind of link that's based on the NWS zone identifier instead: https://forecast.weather.gov/showsigwx.php?warnzone=NVZ003&warncounty=NVC031&firewxzone=NVZ420&local_place1=Reno%20NV&product1=Wind+Advisory&lat=39.5277&lon=-119.8135

Troubleshooting steps

cloneofghosts commented 8 months ago

Thanks for the report. I think the URI is coming straight from NOAA but I could be wrong. I'm going to ping @alexander0042 to take a look at this issue.

alexander0042 commented 8 months ago

Hi,

Thanks for opening this issue- it's a great catch! The URL formatting did change on me there, and I must have missed the service update bulletin.

The good news is that this is fixed (along with other alert improvements) in V2, which is ready for beta testing at the dev.pirateweather.net endpoint. If you have a minute to take a look there and see if it's working, I'd appreciate it!

cloneofghosts commented 7 months ago

Just did a quick test for Ripley, OH and I can confirm this is fixed in the V2 API so will close this issue.