Author Topic: Reading locally stored NWS XML files  (Read 514 times)

0 Members and 1 Guest are viewing this topic.

Offline SoMDWx

  • Forecaster
  • *****
  • Posts: 1019
    • Southern Maryland Weather
Reading locally stored NWS XML files
« on: April 07, 2017, 08:35:57 AM »
Hello all!

I am using Curly's nwsalerts PHP script to process alerts. I have a program that is locally storing the XML files from the CAP feed. Is there a way to modify the nwsalerts PHP script to grab those files instead of having to go out and retrieve them from the CAP feed on the NWS servers?


Thanks!

Jim

Offline SoMDWx

  • Forecaster
  • *****
  • Posts: 1019
    • Southern Maryland Weather
Re: Reading locally stored NWS XML files
« Reply #1 on: April 12, 2017, 07:44:54 AM »
Anyone?

Offline Curly

  • Forecaster
  • *****
  • Posts: 724
    • Michiana Weather
Re: Reading locally stored NWS XML files
« Reply #2 on: April 12, 2017, 09:05:10 AM »
The nws-alerts script outputs a file that contains arrays of data for each location. Viewing the alerts is just reading the data file.
Since you have everything saved locally, it would be easier to extract the data and format an output to use in your web page rather that modifying the nws-alerts file that mostly deals with checking/downloading 2 URL's for each location, XML, and sorting data.

Because of the change-over in the near future, there is only one download per location and perhaps it could be used to get local files.
Are your files saved in the original CAP format?  Can you get geo/json files?
« Last Edit: April 12, 2017, 09:15:03 AM by Curly »

Offline SoMDWx

  • Forecaster
  • *****
  • Posts: 1019
    • Southern Maryland Weather
Re: Reading locally stored NWS XML files
« Reply #3 on: April 12, 2017, 09:24:40 AM »
Curly,
  It's in the CAP format..... I have written a piece of software to pull those counties down locally. The nwsalerts PHP script has to go out and grab those each time..

Jim