Skip to content

pyckle/oref-alerts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

oref-alerts

An Unofficial Java Library and Swing UI to programmically access and display Alerts from Israel's Homefront Command

What is the purpose of this project?

  • A Java library that reliably receives alerts from Pekudei Oref's unofficial REST APIs
    • Programmatically merge output of multiple Oref REST APIs
    • Automatically update information asynchronously to program execution
  • A SwingUI that displays recent historical alerts and regularly updates with new alerts
  • Lightweight - must run on a Raspberry Pi 3A+ (512 MB RAM) and render at 1080p

Features

  • Rich library with clean API to integration with Pekudei Oref's unofficial APIs

    • Updates from Unofficial Pekudei Oref API regularly
    • Refreshes historical API in the case of a network outage to prevent missed Alerts
    • Fetches city and alert translations from Oref APIs
    • Respects HTTP Caching Headers and adds in random delay to avoid server load after cache expiration
    • Decodes alert time from Alert API id (which appears to use Microsoft's Filetime Epoch). Graceful fallback on failure
  • SwingUI to display alerts

    • Designed to work well on wide screens, not narrow phones
    • Autoresize number of alerts displayed based on window size
    • Shows last updated time from last-modified HTTP Response Header (rather than local or server timestamp)
    • Supports Hebrew, English, Russian, and Arabic
    • Minimalistic
      • Very few dependencies
      • JAR is <.5MB
      • Runs fine with 32 MB Java Heap

TODO

  • More automated tests are necessary
  • Support multiple monitors
  • Add more visible warning:
    • If updates fail to fetch
    • On specific area(s)
  • Better documentation

Build Instructions

Requirements

  • Java 17+
  • A recent version of Maven
  • Access to Pekudei Oref (limited to Israel IPs)

Build Instructions

Checkout this repository
run

mvn clean install
A self executable jar will be built:
./oref-swingui/target/oref-swingui.jar
Run it!

java -jar ./oref-swingui/target/oref-swingui.jar

If you want to change the language (Hebrew by default)

java -jar ./oref-swingui/target/oref-swingui.jar en

or make the font bigger

java -jar ./oref-swingui/target/oref-swingui.jar 20 en

To make it fullscreen on Linux, type the display number that should be fullscreen. 0 for example. To exit fullscreen, type f

On Mac, maximize the application.

Windows has not been tested, but in theory this application should be portable.

Disclaimers

This application is not intended as a substitute to adhering to Homefront Command's guidelines. It should not be relied upon for receiving live saving notifications.

Always follow official lifesaving instructions and procedures.

This application relies upon undocumented and unofficial Pekudei Oref APIs. This project also integrates with API behavior that the official Web UI and other OSS projects do not integrate with. For example:

  • Timestamps are parsed from alert IDs and HTTP headers.
  • Refresh behavior is affected by HTTP cache headers.

While the author made efforts to ensure graceful fallback in the event that these parts of the API changes, testing has not been done. As such, while this library is more featureful than other integrations, it may also be less robust to API changes.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages