Implementation of Israel Home Front Command's (AKA "Pikud Ha Oref") public API, gets real-time alerts about rockets lunched from Gaza-strip into Israel's territory.
RedAlert is a library that synchronizing with Israel Home Front Command's API to get the alerts in real-time, the library interface is user-friendly and has lots of features which are described below.
-
Gets red alerts in real-time.
-
Fetches location data from alerts location (coordinates, city names, city zones, time to run for safe-zone)
-
Supports 4 languages: Hebrew, Arabic, Russian and English.
-
Gets the picture of Israel with markers over the alert's location with path lines.
using RedAlert;
private static void Main()
{
//Creating the event subscriber
Alerts alerts = new Alerts();
alerts.OnAlertReceived += Alerts_OnAlertReceived;
}
private static void Alerts_OnAlertReceived(List<AlertCityData> cities)
{
//With every new alert, this function will executed.
DateTime occurence = cities[0].Timestamp;
List<string> zones = new List<string>();
List<string> descriptions = new List<string>();
List<string> result = new List<string>();
//Sorting the cities zones
foreach (AlertCityData city in cities)
{
if (!zones.Contains(city.Zone_he))
zones.Add(city.Zone_he);
}
//Sorting all the alerts, every alert into his zone.
for (int i = 0; i < zones.Count; ++i)
{
descriptions.Add("");
foreach (AlertCityData city in cities)
{
if (city.Zone_he != zones[i])
continue;
descriptions[i] += $"{city.Name_he} - ({city.Time_he})\n";
}
}
//Adding the results into a list for easier use.
for (int i = 0; i < zones.Count; ++i)
result.Add($"{zones[i]}\n\n{descriptions[i]}");
//Printing the alerts with their information
Console.WriteLine($"New Alert! [{occurence.ToShortDateString()}] {occurence.ToShortTimeString()}:\n" + string.Join("\n\n", result));
}
- This library will only work for people whose locations is in Israel because Israel Home Front Command (Pikud Ha Oref) accepts only the requests from Israel.
- The enemy cannot exploit or use this library for bad usage because it does not contain any private sensitive information, we use the public API of Israel Home Front Command (Pikud Ha Oref)
- This library is very simple to use and have very good performance
Newtonsoft.Json 13.0.1
Installation:
Install-Package Newtonsoft.Json -Version 13.0.1
- The source code doesn’t need to be public when a distribution of the software is made.
- Modifications to the software can be released under any license.
- Changes made to the source code may not be documented.
- It offers no explicit position on patent usage.
- The license and copyright notice must be included in the documentation of the compiled version of the source code (as opposed to only in the source code).
- The BSD 3-clause states that the names of the author and contributors can’t be used to promote products derived from the software without permission.
"Copyright Disclaimer Under Section 107 of the Copyright Act 1976, allowance is made for "fair use" for purposes such as criticism, comment, news reporting, teaching scholarship, and research. Fair use is a use permitted by copyright statutes that might otherwise be infringing. Non-profit, educational, or personal use tips the balance in favor of fair use."