Skip to content

Commit

Permalink
added getVolcanicEruptions() method
Browse files Browse the repository at this point in the history
  • Loading branch information
JeanExtreme002 committed Dec 25, 2023
1 parent e8a6705 commit 70e5d26
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 5 deletions.
12 changes: 12 additions & 0 deletions nodejs/FlightRadar24/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,18 @@ class FlightRadar24API {
return await response.getContent();
}

/**
* Return boundaries of volcanic eruptions and ash clouds impacting aviation.
*
* @return {object}
*/
async getVolcanicEruptions() {
const response = new APIRequest(Core.volcanicEruptionDataUrl, null, Core.json_headers);
await response.receive();

return await response.getContent();
}

/**
* Return all major zones on the globe.
*
Expand Down
3 changes: 3 additions & 0 deletions nodejs/FlightRadar24/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ class Core {
// Zones data URL.
this.zonesDataUrl = this.flightRadarBaseUrl + "/js/zones.js.php";

// Weather data URL.
this.volcanicEruptionDataUrl = this.flightRadarBaseUrl + "/weather/volcanic";

// Country flag image URL.
this.countryFlagUrl = this.flightRadarBaseUrl + "/static/images/data/flags-small/{}.svg";

Expand Down
2 changes: 1 addition & 1 deletion nodejs/FlightRadar24/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const Entity = require("./entities/entity");
const Flight = require("./entities/flight");

const author = "Jean Loui Bernard Silva de Jesus";
const version = "1.3.21";
const version = "1.3.22";

module.exports = {
FlightRadar24API,
Expand Down
4 changes: 2 additions & 2 deletions nodejs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion nodejs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "flightradarapi",
"version": "1.3.21",
"version": "1.3.22",
"description": "SDK for FlightRadar24",
"main": "./FlightRadar24/index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion python/FlightRadar24/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"""

__author__ = "Jean Loui Bernard Silva de Jesus"
__version__ = "1.3.19"
__version__ = "1.3.20"

from .api import FlightRadar24API, FlightTrackerConfig
from .entities import Airport, Entity, Flight
7 changes: 7 additions & 0 deletions python/FlightRadar24/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,13 @@ def get_most_tracked(self) -> Dict:
response = APIRequest(Core.most_tracked_url, headers = Core.json_headers)
return response.get_content()

def get_volcanic_eruptions(self) -> Dict:
"""
Return boundaries of volcanic eruptions and ash clouds impacting aviation.
"""
response = APIRequest(Core.volcanic_eruption_data_url, headers = Core.json_headers)
return response.get_content()

def get_zones(self) -> Dict[str, Dict]:
"""
Return all major zones on the globe.
Expand Down
3 changes: 3 additions & 0 deletions python/FlightRadar24/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ class Core(ABC):
# Zones data URL.
zones_data_url = flightradar_base_url + "/js/zones.js.php"

# Weather data URL.
volcanic_eruption_data_url = flightradar_base_url + "/weather/volcanic"

# Country flag image URL.
country_flag_url = flightradar_base_url + "/static/images/data/flags-small/{}.svg"

Expand Down

0 comments on commit 70e5d26

Please sign in to comment.