AtmosphericX/pulse-point-wrapper

GitHub: AtmosphericX/pulse-point-wrapper

一个未官方认证的 NPM 模块,提供拉取并解密 PulsePoint 实时应急事件数据的能力。

Stars: 2 | Forks: 0

🚒 AtmosphericX - PulsePoint Wrapper 🚨

PulsePoint is a public emergency response system used by fire departments, EMS agencies, and dispatch centers to share live incident information with the public. This module provides a way to poll and decrypt the data provided by PulsePoint. Please keep in mind that this module is unofficial and not endorsed by PulsePoint or its parent organization. This module is primarily intended for use with the https://github.com/k3yomi/AtmosphericX project.

Documentation written by @k3yomi

GitHub Repo stars GitHub forks GitHub issues GitHub pull requests
## 安装(NPM) ``` npm install @atmosx/pulse-point-wrapper ``` ## 示例用法 ``` const { PulsePoint } = require(`@atmosx/pulse-point-wrapper`); // CJS import { PulsePoint } from `@atmosx/pulse-point-wrapper`; // ESM const pulse = new PulsePoint({ key: `YOUR_PASSWORD_KEY_FOR_DECRYPTION`, // Not provided by PulsePoint, you must obtain this key yourself. interval: 30, // Polling interval in seconds (default: 60) jorunal: true, // Enable journaling for debug messages (default: true) filtering: { events: ["Mutual Aid", "Structure Fire"], // Leave empty to allow all event types agencies: ["FIRE5678", "EMS1234"], // This must be populated, leaving empty will NOT return any data. } }) ``` ## 解密密钥 默认情况下,PulsePoint 使用客户端加密来保护数据。要解密数据,您需要在初始化模块时提供解密密钥。此密钥不由 PulsePoint 提供,您必须自行获取。只有已经拥有解密密钥的用户才能使用本模块,以便将其集成到自己的应用程序中。 请确保遵守所有相关法律法规,因为我对您如何使用本模块或获取的数据不承担任何责任。 ## 事件与监听器 ### 事件 `onIncidentUpdate` 每当事件数据有更新或新事件发生时,此监听器会被触发。回调函数会接收一个事件对象数组,您可以根据需要处理或显示这些数据。 ``` pulse.on(`onIncidentUpdate`, (incident) => { console.log(incident); }); ``` ### 事件 `onIncidentClosed` 当事件被关闭时,此监听器会被触发。收到事件后,您应处理相关数据以保持对活跃事件的实时视图。 ``` pulse.on(`onIncidentClosed`, (incidentID) => { console.log(incidentID); }); ``` ### 事件 `Log` 日志监听器会捕获模块运行期间生成的日志消息。这对于调试或监控模块活动非常有用。仅在禁用日志记录时生效;否则,日志消息会直接显示在控制台中。 ``` pulse.on(`log`, (message) => { console.log(`[Log]: ${message}`); }); ``` ## 回调与函数 ### 函数 `getAvailableAgencies()` 此异步函数从 PulsePoint 数据源获取可用机构列表。它返回一个可用于过滤或其他用途的机构标识符数组。 ``` pulse.getAvailableAgencies().then((agencies) => { console.log(agencies); }); ``` ### 函数 `getAvailableEvents()` 此函数从 PulsePoint 数据源获取可用事件类型列表。它返回 一个可用于过滤或其他用途的事件类型字符串数组。 ``` pulse.getAvailableEvents() ``` ### 函数 `setSettings({})` 此函数允许您动态更新模块设置。您可以更改轮询间隔、日志记录偏好和过滤选项等参数。 ``` pulse.setSettings({ interval: 45, // Update polling interval to 45 seconds journaling: false, // Disable journaling filtering: { events: ["Medical Emergency"], // Update event filtering agencies: ["FIRE1234"], // Update agency filtering } }); ``` ### 函数 `stop()` 此函数会停止轮询过程。当您希望临时暂停数据检索而不销毁模块实例时,可以使用它。 ``` pulse.stop(); ``` ## 参考文档 [PulsePoint](https://www.pulsepoint.org/) | [文档](https://atmosphericx.scriptkitty.cafe/documentation) | [Discord 服务器](https://atmosphericx-discord.scriptkitty.cafe) | [项目看板](https://github.com/users/AtmosphericX/projects/2) |\ [行为准则](/CODE_OF_CONDUCT.md) | [贡献指南](/CONTRIBUTING.md) | [许可证](/LICENSE) | [安全](/SECURITY.md) | [更新日志](/CHANGELOGS.md) | ## 感谢 - [CJ Ziegler](https://www.youtube.com/channel/UCx_mcHxMvZ8PBmVTtg6Ddtw) - 感谢他激发我创建此模块,用于风暴追踪和夜间流媒体。 - 风暴追踪者 @ AtmosphericX - [k3yomi](https://github.com/k3yomi) - 首席开发者 @ AtmosphericX 及本模块的维护者。 - [StarflightWx](https://x.com/starflightVR) - 参与测试并提供反馈(联合开发者与风暴追踪者 @ AtmosphericX)
标签:AtmosphericX, Cilium, CMS安全, EMS, GNU通用公共许可证, JavaScript, MITM代理, Node.js, NPM, PulsePoint, SEO应急响应, 事件过滤, 信息共享, 公共安全, 加密, 实时数据, 客户端加密, 库, 应急响应, 开源, 数据可视化, 数据解密, 机构过滤, 模块, 漏洞扫描器, 火警, 紧急事件, 调度中心, 轮询, 非官方模块