eladnava / pikud-haoref-api

A Node.js wrapper library for Pikud Haoref's unofficial rocket alert API.
Apache License 2.0
71 stars 11 forks source link

Stopped working #1

Closed sidan5 closed 6 years ago

sidan5 commented 7 years ago

Nothing is being returned. I guess the URL have been changed.

eladnava commented 6 years ago

Hi @sidan5, The package still works like a champ.

Nothing is being returned because, thankfully, there are no active rocket alerts currently in Israel! No rockets were launched when you ran the package.

The package will only return active rocket alert zone names when the "Tzeva Adom" alert sounds in one or more zones in Israel.

sidan5 commented 6 years ago

I have nothing in my logs for the last rocket alerts (service run for more than a year without any issues)

eladnava commented 6 years ago

Hi @sidan5, The official Pikud Haoref website lists the last alert on October 21st (two days ago): http://www.oref.org.il/11096-he/Pakar.aspx

This package did return alert zones on October 21st at 5AM (גולן 2, גולן 3, קצרין 6).

I know this for sure because my RedAlert app which is based on this package has alerted the users about these rocket alerts and stored them in the backend database:

+------+------------+--------------+
| id   | date       | area         |
+------+------------+--------------+
| 4242 | 1508551275 | גולן 3       |
| 4241 | 1508551275 | קצרין 6      |
| 4240 | 1508551275 | גולן 2       |
+------+------------+--------------+
3 rows in set (0.18 sec)
eladnava commented 6 years ago

Also, please make sure you are polling for rocket alerts every second or so, and not longer, because Pikud Haoref will return the alert zones only for a limited period of time (about 10 seconds) until they no longer return them, even if a Tzeva Adom alarm is still sounding in these zones.

sidan5 commented 6 years ago

@eladnava Are you polling from Israel?

eladnava commented 6 years ago

@sidan5 Nope. Polling from AWS North Virginia (us-east-1).

sidan5 commented 6 years ago

@eladnava Restarted the entity and now it works perfect. Probably my IP was banned or something...I'm polling every second, maybe that's too often?

eladnava commented 6 years ago

@sidan5 I poll every second as well, for the last 4 years or so, without any issue. 👍

sidan5 commented 6 years ago

@eladnava Ok. Maybe some other issue that was cleared out (new instance solved). I'll wait for next time. Thank you!

eladnava commented 6 years ago

@sidan5 Awesome. My pleasure man!