-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
62 lines (59 loc) · 1.79 KB
/
test.js
File metadata and controls
62 lines (59 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
const { AlertManager } = require(`@atmosx/event-product-parser`)
const parser = new AlertManager({
database: `shapefile-manager.db`,
is_wire: true,
journal: true,
noaa_weather_wire_service_settings: {
reconnection_settings: {
enabled: true,
interval: 60,
},
credentials: {
username: `username123`,
password: `password123`,
nickname: "AtmosphericX Standalone Parser",
},
cache: {
enabled: false,
max_db_history: 5000,
max_db_cache_size: 1000,
},
preferences: {
disable_ugc: false,
disable_vtec: false,
disable_text: false,
cap_only: false,
}
},
national_weather_service_settings: {
interval: 15,
endpoint: `https://api.weather.gov/alerts/active`,
},
global_settings: {
parent_events_only: true,
better_event_parsing: true,
ignore_geometry_parsing: false,
shapefile_coordinates: true,
filtering: {
events: [`Severe Thunderstorm Warning`],
filtered_icao: ["PAFC"],
ignored_icao: [],
ignored_events: [`Xx`, `Test Message`],
ugc_filter: [],
state_filter: [],
check_expired: true,
ignore_test_products: true,
},
eas_settings: {
directory: null,
intro_wav: null,
}
}
})
parser.on(`onEvents`, (alerts) => {
for (const alert of alerts) {
if (alert.geometry != null) {
console.log(`[${ new Date(alert.properties.issued).toLocaleString()}] ${alert.properties.event} for ${alert.properties.locations} (ID: ${alert.properties.details.tracking})`);
}
}
});