You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+30-29Lines changed: 30 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,16 +61,16 @@ if (config.testing) {
61
61
62
62
I would highly recommend checking out my code on [our GitHub location here](https://github.com/mwalden2004/National-Weather-Service-Open-Interface-Realtime-Parser), and helping make it better! If you have an issue, feel free to open an issue there.
63
63
64
-
## Most Recent Update Info: VERSION: 1.0.6
64
+
## Most Recent Update Info: VERSION: 1.0.7
65
65
66
66
Added new information in returned events
67
67
```json
68
-
{ phenomena: 'Severe Thunderstorm',
69
-
significance: 'Warning',
70
-
action: 'New event',
71
-
start: 2019-01-20T04:39:00.000Z,
72
-
end: 2019-01-20T05:15:00.000Z,
73
-
polygon:
68
+
{ "phenomena": 'Severe Thunderstorm',
69
+
"significance": 'Warning',
70
+
"action": 'New event',
71
+
"start": "2019-01-20T04:39:00.000Z",
72
+
"end": "2019-01-20T05:15:00.000Z",
73
+
"polygon":
74
74
[ [ -85.44, '32.39' ],
75
75
[ -85.44, '32.49' ],
76
76
[ -85.45, '32.50' ],
@@ -86,33 +86,34 @@ Added new information in returned events
86
86
[ -85.07, '32.58' ],
87
87
[ -85.01, '32.52' ],
88
88
[ -84.99, '32.49' ],
89
-
[ -85, '32.46' ],
89
+
[ -85, '32.46' ],
90
90
[ -84.97, '32.44' ],
91
91
[ -84.96, '32.42' ],
92
-
[ -85.44, '32.39' ] ],
93
-
PDS: false,
94
-
Counties: [ 'Lee County', 'Northern Russell County' ],
95
-
extras:
96
-
{ HAZARD: '60 mph wind gust',
97
-
SOURCE: 'Radar indicated',
98
-
IMPACT: 'Expect damage to roofs, siding, and trees',
99
-
ACTIONS:
100
-
'For your protection move to an interior room on the lowest floor of a building.' },
101
-
back_data:
102
-
{ office_id: 'KBMX',
103
-
productclass: 'O',
104
-
event_tracking: '0001',
105
-
raw_attrs:
106
-
{ xmlns: 'nwws-oi',
107
-
cccc: 'KJAN',
108
-
ttaaii: 'WUUS54',
109
-
issue: '2019-10-26T14:38:00Z',
110
-
awipsid: 'SVRJAN',
111
-
id: '13743.3632' },
112
-
raw_msg:
92
+
[ -85.44, '32.39' ]
93
+
],
94
+
"PDS": false,
95
+
"Counties": [ 'Lee County', 'Northern Russell County' ],
96
+
"extras":
97
+
{ "HAZARD": '60 mph wind gust',
98
+
"SOURCE": 'Radar indicated',
99
+
"IMPACT": 'Expect damage to roofs, siding, and trees',
100
+
"ACTIONS":'For your protection move to an interior room on the lowest floor of a building.' },
101
+
"back_data": {
102
+
"office_id": 'KBMX',
103
+
"productclass": 'O',
104
+
"event_tracking": '0001',
105
+
"raw_attrs":
106
+
{ "xmlns": 'nwws-oi',
107
+
"cccc": 'KJAN',
108
+
"ttaaii": 'WUUS54',
109
+
"issue": '2019-10-26T14:38:00Z',
110
+
"awipsid": 'SVRJAN',
111
+
"id": '13743.3632' },
112
+
"raw_msg":
113
113
'950\n WUUS54 KBMX 192239\n SVRBMX\n ALC081-113-192315-\n /O.NEW.KBMX.SV.W.0001.190119T2239Z-190119T2315Z/\n \n BULLETIN - IMMEDIATE BROADCAST REQUESTED\n Severe Thunderstorm Warning\n National Weather Service Birmingham AL\n 439 PM CST SAT JAN 19 2019\n \n The National Weather Service in Birmingham has issued a\n \n * Severe Thunderstorm Warning for...\n Lee County in east central Alabama...\n Northern Russell County in southeastern Alabama...\n \n * Until 515 PM CST.\n \n * At 439 PM CST, severe thunderstorms were located along a line\n extending from near Beans Mill to Society Hill, moving northeast at\n 45 mph.\n \n HAZARD...60 mph wind gusts.\n \n SOURCE...Radar indicated.\n \n IMPACT...Expect damage to roofs, siding, and trees.\n \n * Locations impacted include...\n Auburn, Phenix City, Opelika, Smiths, Smiths Station, Beulah, Beans\n Mill, Ladonia, Beauregard, Bleecker, Griffen Mill, Bibb City,\n Monterey Heights, Ladonia Sports Complex, Marvyn, Phenix Drag Strip\n and Mount Jefferson.\n \n PRECAUTIONARY/PREPAREDNESS ACTIONS...\n \n For your protection move to an interior room on the lowest floor of a\n building.\n \n &&\n \n A Tornado Watch remains in effect until 900 PM CST for southeastern\n and east central Alabama.\n \n LAT...LON 3239 8544 3249 8544 3250 8545 3273 8538\n 3273 8529 3275 8528 3274 8512 3269 8512\n 3266 8509 3265 8511 3263 8508 3262 8509\n 3258 8507 3252 8501 3249 8499 3246 8500\n 3244 8497 3242 8496\n TIME...MOT...LOC 2239Z 245DEG 40KT 3272 8530 3244 8543\n \n HAIL...<.75IN\n WIND...60MPH\n \n $$\n \n 89^GSatterwhite' } }
114
114
```
115
115
Specifically: Counties, Extras, PDS.
116
+
Fixed some parsing issues too. Testing using https://mesonet.agron.iastate.edu/vtec/#2019-O-NEW-KBMX-SV-W-0001/USCOMP-N0Q-201901192235
116
117
117
118
Layed infunstrucutre to split parsing into seperate files. *as much as i'd love to have a 20k line file*
letCountiesListed=[];//Array where counties will be stored
132
-
letstartCounties=msg.indexOf("* "+Phenomenas[phenomena]+" "+Significances[significance]+" for...");//Find the begging of the counties
133
-
letendCounties=msg.indexOf("* Until ");//End of counties, find the next start
134
-
letCounties=msg.substring(startCounties,endCounties).replace("* "+Phenomenas[phenomena]+" "+Significances[significance]+" for...","").replace(//g,"").split("\n");//Substring for all counties
132
+
letstartCounties=msg.toLowerCase().indexOf("* "+Phenomenas[phenomena]+" "+Significances[significance]+" for...".toLowerCase());//Find the begging of the counties
133
+
letendCounties=msg.toLowerCase().indexOf("* until ");//End of counties, find the next start
134
+
letCounties=msg.substring(startCounties,endCounties).toLowerCase().replace("* "+Phenomenas[phenomena]+" "+Significances[significance]+" for...".toLowerCase(),"").replace(//g,"").split("\n");//Substring for all counties
135
135
Counties.forEach(county=>{//Put all counties into one string.
136
-
letpushCounty=county.substring(0,county.search(" County"))+" County";//Get rid of everything but county name/part of county.
136
+
letpushCounty=county.substring(0,county.toLowerCase().search(" county"))+" County";//Get rid of everything but county name/part of county.
137
137
if(county!==''&&county!==' County'&&!county.match(//g)){//Regex for weird whitespace/tabs.
138
-
CountiesListed.push(pushCounty);//Add counties to array
138
+
CountiesListed.push(pushCounty.toLowerCase());//Add counties to array
139
139
}
140
140
});
141
141
142
142
letextra_info={
143
143
144
144
};
145
-
146
-
if(msg.search("SOURCE...")){
145
+
146
+
if(msg.search("SOURCE...")!==-1){
147
147
conststartSub=msg.search("SOURCE...");//this is such a forking hack. i approve. [can someone do a good pull, really thinking about dividing warnings/watches into their own parsers.]
conststartSub=msg.search("IMPACT...");//this is such a forking hack. i approve. [can someone do a good pull, really thinking about dividing warnings/watches into their own parsers.]
0 commit comments