Closed shirser121 closed 2 years ago
Hi @shirser121, The response is a JSON array of strings, where each string is a city name:
["תל אביב - מזרח", "חיפה - כרמל ועיר תחתית", "עין גדי"]
Let me know if you have any additional questions.
Hi @shirser121, The response is a JSON array of strings, where each string is a city name:
["תל אביב - מזרח", "חיפה - כרמל ועיר תחתית", "עין גדי"]
Let me know if you have any additional questions.
Maybe we should add time for every alert. And I think its important to add the format to the documents
Hi @shirser121,
At the moment, pikud-haoref-api
provides a wrapper around the Home Front Command's alerts.json
API, taking care of things like strange encodings and BOMs.
To listen for rocket alerts, you must poll the API by repeatedly calling pikudHaoref.getActiveRocketAlertCities()
, which will usually return an empty JSON array, until there is an active code red alert. As soon as the response changes from an empty JSON array to an array with city names, you can save the current time (new Date().getTime()
).
Finally, the format is currently documented in the Usage section of the README as a comment above pikudHaoref.getActiveRocketAlertCities()
:
// Example response: ["תל אביב - מזרח", "חיפה - כרמל ועיר תחתית", "עין גדי"]
Hi, I just want to start using this API, and I need to know what format I get when the alert return, is that JSON, or text