flight_radar 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +6 -0
- data/.github/workflows/ruby.yml +3 -2
- data/.rubocop.yml +3 -15
- data/.yardopts +1 -0
- data/CHANGELOG.md +34 -0
- data/Gemfile +9 -1
- data/README.md +258 -120
- data/Rakefile +3 -3
- data/flight_radar.gemspec +22 -18
- data/lib/flight_radar/core.rb +40 -35
- data/lib/flight_radar/flight.rb +109 -73
- data/lib/flight_radar/request.rb +80 -38
- data/lib/flight_radar/version.rb +5 -0
- data/lib/flight_radar.rb +115 -39
- metadata +21 -50
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 577b655ed0ac3653a99092e3e9c076befa0c8c1b58c205da36e01c49979cb7c6
|
|
4
|
+
data.tar.gz: 020ffcf2ac3b110f0424cf2fc9b5e09c63e165efb5eae7be6ffff904d9d9660d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 306207a684236c5e747a32eca79272b43163f2364c2f73efe8f8339b971ddffec7be3e11c5b11f0048b2bc14f0bab85fe2441c86b1c6028be3482ecc4c56cbe6
|
|
7
|
+
data.tar.gz: 6675ebe2ea8b5e8e0fee89b40aa4f8875132650ade80db3c4998d394f3d454c3257fd2e5433c841ef8a3e1557ad30c50e302e54f811f68b4d64ef210a0725f75
|
data/.github/workflows/ruby.yml
CHANGED
|
@@ -19,7 +19,8 @@ jobs:
|
|
|
19
19
|
- name: Set up Ruby and install dependencies
|
|
20
20
|
uses: ruby/setup-ruby@v1
|
|
21
21
|
with:
|
|
22
|
-
ruby-version: 3.
|
|
22
|
+
ruby-version: 3.2
|
|
23
|
+
bundler-cache: true
|
|
23
24
|
|
|
24
25
|
- name: Install dependencies
|
|
25
26
|
run: |
|
|
@@ -27,4 +28,4 @@ jobs:
|
|
|
27
28
|
bundle install
|
|
28
29
|
|
|
29
30
|
- name: Run RSpec tests
|
|
30
|
-
run: bundle exec rake
|
|
31
|
+
run: bundle exec rake
|
data/.rubocop.yml
CHANGED
|
@@ -1,16 +1,4 @@
|
|
|
1
1
|
AllCops:
|
|
2
|
-
TargetRubyVersion: 2
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Enabled: true
|
|
6
|
-
EnforcedStyle: double_quotes
|
|
7
|
-
|
|
8
|
-
Style/StringLiteralsInInterpolation:
|
|
9
|
-
Enabled: true
|
|
10
|
-
EnforcedStyle: double_quotes
|
|
11
|
-
|
|
12
|
-
Layout/LineLength:
|
|
13
|
-
Max: 120
|
|
14
|
-
|
|
15
|
-
Layout/EndOfLine:
|
|
16
|
-
Enabled: False
|
|
2
|
+
TargetRubyVersion: 3.2
|
|
3
|
+
NewCops: enable
|
|
4
|
+
SuggestExtensions: false
|
data/.yardopts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
--markup markdown
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [0.3.0] - 2025-11-25
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- New `search(query, limit)` method for searching flights, airports, and airlines
|
|
7
|
+
- New `most_tracked` method to retrieve most tracked flights in real-time
|
|
8
|
+
- New `flight_playback(flight_id)` method for retrieving flight path history
|
|
9
|
+
- New `aircraft(registration)` method for searching aircraft by registration number
|
|
10
|
+
- New `airline_fleet(airline_code)` method for retrieving airline fleet information
|
|
11
|
+
- Added `attr_reader` for all Flight class instance variables (icao_24bit, latitude, longitude, squawk, aircraft_code, registration, time, origin_airport_iata, destination_airport_iata, number, airline_iata, on_ground, callsign, airline_icao)
|
|
12
|
+
- Enhanced gemspec with bug_tracker_uri and documentation_uri metadata
|
|
13
|
+
- Updated README with comprehensive documentation for all new methods
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
- Fixed bug in Flight#to_s method where heading was displaying ground_speed value
|
|
17
|
+
- Fixed HEADERS constant mutation issue in Core module by using .merge() and .freeze
|
|
18
|
+
- Fixed inconsistent Request class usage in airport and flight_details methods
|
|
19
|
+
- Fixed flight_level method attempting to slice integer instead of properly dividing by 100
|
|
20
|
+
- Fixed ground_speed method type comparison issue
|
|
21
|
+
- Fixed airline_iata extraction to safely handle nil/short values
|
|
22
|
+
- Fixed flaky airline_logo test to require at least 1 logo instead of exactly 2
|
|
23
|
+
|
|
24
|
+
### Changed
|
|
25
|
+
- Refactored airport method to use Request class instead of direct HTTParty.get
|
|
26
|
+
- Refactored flight_details method to use Request class for consistency
|
|
27
|
+
- Updated GitHub Actions workflow to use Ruby 3.2
|
|
28
|
+
- Added bundler-cache to CI for faster builds
|
|
29
|
+
- Gemspec now loads version dynamically from FlightRadar::VERSION
|
|
30
|
+
- Enhanced gemspec description with more details
|
|
31
|
+
|
|
32
|
+
## [0.2.1] - 2023-12-21
|
|
33
|
+
- Code refactor
|
|
34
|
+
- Add documentation to the code
|
|
35
|
+
- Apply rubocop suggestions
|
|
36
|
+
|
|
3
37
|
## [0.2.0] - 2023-12-20
|
|
4
38
|
|
|
5
39
|
- Make the gem work again
|
data/Gemfile
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
source
|
|
3
|
+
source 'https://rubygems.org'
|
|
4
4
|
|
|
5
5
|
# Specify your gem's dependencies in flight_radar.gemspec
|
|
6
6
|
gemspec
|
|
7
|
+
|
|
8
|
+
group :development do
|
|
9
|
+
gem 'rake'
|
|
10
|
+
gem 'redcarpet'
|
|
11
|
+
gem 'rspec'
|
|
12
|
+
gem 'rubocop'
|
|
13
|
+
gem 'yard'
|
|
14
|
+
end
|
data/README.md
CHANGED
|
@@ -3,6 +3,31 @@
|
|
|
3
3
|
|
|
4
4
|
**Fetch aircraft data from Flightradar24.**
|
|
5
5
|
|
|
6
|
+
# Table of Contents
|
|
7
|
+
- [Installation](#installation)
|
|
8
|
+
- [Usage](#usage)
|
|
9
|
+
- [Airlines](#airlines)
|
|
10
|
+
- [Airport](#airport)
|
|
11
|
+
- [Airports](#airports)
|
|
12
|
+
- [Zones](#zones)
|
|
13
|
+
- [Flights](#flights)
|
|
14
|
+
- [Flight Details](#flight-details)
|
|
15
|
+
- [Flight Playback](#flight-playback)
|
|
16
|
+
- [Flights by Airline](#flights-by-airline)
|
|
17
|
+
- [Flights by Bounds](#flights-by-bounds)
|
|
18
|
+
- [Search](#search)
|
|
19
|
+
- [Most Tracked Flights](#most-tracked-flights)
|
|
20
|
+
- [Aircraft Information](#aircraft-information)
|
|
21
|
+
- [Airline Fleet](#airline-fleet)
|
|
22
|
+
- [Airline Logo](#airline-logo)
|
|
23
|
+
- [Country Flag](#country-flag)
|
|
24
|
+
- [Documentation](#documentation)
|
|
25
|
+
- [Development](#development)
|
|
26
|
+
- [Contributing](#contributing)
|
|
27
|
+
- [License](#license)
|
|
28
|
+
- [Code of Conduct](#code-of-conduct)
|
|
29
|
+
|
|
30
|
+
|
|
6
31
|
## Installation
|
|
7
32
|
|
|
8
33
|
Add this line to your application's Gemfile:
|
|
@@ -26,194 +51,208 @@ Or install it yourself as:
|
|
|
26
51
|
```ruby
|
|
27
52
|
FlightRadar.airlines
|
|
28
53
|
```
|
|
54
|
+
|
|
29
55
|
**Sample response:**
|
|
56
|
+
|
|
30
57
|
```ruby
|
|
31
58
|
[
|
|
32
59
|
{"Name"=>"21 Air", "Code"=>"2I", "ICAO"=>"CSB"},
|
|
33
60
|
{"Name"=>"25Only Aviation", "Code"=>"", "ICAO"=>"ONY"},
|
|
34
61
|
{"Name"=>"40-Mile Air", "Code"=>"Q5", "ICAO"=>"MLA"},
|
|
35
|
-
|
|
62
|
+
# ...
|
|
36
63
|
]
|
|
37
64
|
```
|
|
65
|
+
|
|
38
66
|
### Airport
|
|
67
|
+
|
|
68
|
+
Get traffic statistics for a specific airport.
|
|
69
|
+
|
|
39
70
|
```ruby
|
|
40
|
-
airport
|
|
41
|
-
FlightRadar.airport(airport)
|
|
71
|
+
FlightRadar.airport("LAX")
|
|
42
72
|
```
|
|
73
|
+
|
|
43
74
|
**Sample response:**
|
|
75
|
+
|
|
44
76
|
```ruby
|
|
45
77
|
{
|
|
46
|
-
"details"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
},
|
|
52
|
-
"position""=>"{
|
|
53
|
-
"latitude"=>51.721882,
|
|
54
|
-
"longitude"=>19.39813,
|
|
55
|
-
"altitude"=>604,
|
|
56
|
-
"country""=>"{
|
|
57
|
-
"id""=>nil",
|
|
58
|
-
"name""=>""Poland",
|
|
59
|
-
"code""=>""POL"
|
|
78
|
+
"details" => {
|
|
79
|
+
"name" => "Los Angeles International Airport",
|
|
80
|
+
"code" => {
|
|
81
|
+
"iata" => "LAX",
|
|
82
|
+
"icao" => "KLAX"
|
|
60
83
|
},
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
84
|
+
"position" => {
|
|
85
|
+
"latitude" => 33.942536,
|
|
86
|
+
"longitude" => -118.408075,
|
|
87
|
+
"altitude" => 125,
|
|
88
|
+
"country" => {
|
|
89
|
+
"name" => "United States",
|
|
90
|
+
"code" => "USA"
|
|
91
|
+
},
|
|
92
|
+
"region" => {
|
|
93
|
+
"city" => "Los Angeles"
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
# ...
|
|
66
97
|
}
|
|
67
98
|
}
|
|
68
99
|
```
|
|
69
100
|
|
|
70
101
|
### Airports
|
|
102
|
+
|
|
103
|
+
Get a list of all airports.
|
|
104
|
+
|
|
71
105
|
```ruby
|
|
72
|
-
airport = "LAX"
|
|
73
106
|
FlightRadar.airports
|
|
74
107
|
```
|
|
108
|
+
|
|
75
109
|
**Sample response:**
|
|
110
|
+
|
|
76
111
|
```ruby
|
|
77
112
|
[
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
"icao""=>""LECO",
|
|
82
|
-
"lat"=>43.302059,
|
|
83
|
-
"lon"=>-8.37725,
|
|
84
|
-
"country""=>""Spain",
|
|
85
|
-
"alt"=>326
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
"name""=>""Aachen Merzbruck Airport",
|
|
89
|
-
"iata""=>""AAH",
|
|
90
|
-
"icao""=>""EDKA",
|
|
91
|
-
"lat"=>50.823051,
|
|
92
|
-
"lon"=>6.186111,
|
|
93
|
-
"country""=>""Germany",
|
|
94
|
-
"alt"=>623
|
|
95
|
-
},
|
|
96
|
-
...
|
|
113
|
+
{"name" => "Hartsfield-Jackson Atlanta Intl", "iata" => "ATL", "icao" => "KATL", "lat" => 33.6367, "lon" => -84.4281},
|
|
114
|
+
{"name" => "Los Angeles Intl", "iata" => "LAX", "icao" => "KLAX", "lat" => 33.9425, "lon" => -118.408},
|
|
115
|
+
# ...
|
|
97
116
|
]
|
|
98
117
|
```
|
|
99
118
|
|
|
100
119
|
### Zones
|
|
120
|
+
|
|
101
121
|
```ruby
|
|
102
122
|
FlightRadar.zones
|
|
103
123
|
```
|
|
124
|
+
|
|
104
125
|
**Sample response:**
|
|
105
126
|
```ruby
|
|
106
127
|
{
|
|
107
|
-
"europe"
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}
|
|
128
|
+
"europe" => {
|
|
129
|
+
"tl_y" => 72.57,
|
|
130
|
+
"tl_x" => -16.96,
|
|
131
|
+
"br_y" => 33.57,
|
|
132
|
+
"br_x" => 53.05,
|
|
133
|
+
"subzones" => {
|
|
134
|
+
"poland" => {
|
|
135
|
+
"tl_y" => 56.86,
|
|
136
|
+
"tl_x" => 11.06,
|
|
137
|
+
"br_y" => 48.22,
|
|
138
|
+
"br_x" => 28.26
|
|
139
|
+
},
|
|
140
|
+
"germany" => {
|
|
141
|
+
"tl_y" => 57.92,
|
|
142
|
+
"tl_x" => 1.81,
|
|
143
|
+
"br_y" => 45.81,
|
|
144
|
+
"br_x" => 16.83
|
|
145
|
+
},
|
|
146
|
+
# ...
|
|
127
147
|
}
|
|
148
|
+
}
|
|
128
149
|
}
|
|
129
150
|
```
|
|
130
151
|
|
|
131
152
|
### Flights
|
|
153
|
+
|
|
132
154
|
```ruby
|
|
133
155
|
FlightRadar.flights
|
|
134
156
|
```
|
|
135
157
|
|
|
136
158
|
**Sample response:**
|
|
159
|
+
|
|
137
160
|
```ruby
|
|
138
161
|
[
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
162
|
+
"<(GRND) - Altitude: 0 - Ground Speed: 146 - Heading: 146>",
|
|
163
|
+
"<(DRON) TEST4A - Altitude: 374 - Ground Speed: 1 - Heading: 1>",
|
|
164
|
+
"<(GLID) STM32 - Altitude: 2290 - Ground Speed: 1 - Heading: 1>",
|
|
165
|
+
"<() - Altitude: 508 - Ground Speed: 7 - Heading: 7>",
|
|
166
|
+
"<(B763) N142FE - Altitude: 0 - Ground Speed: 0 - Heading: 0>",
|
|
167
|
+
"<(GRND) - Altitude: 0 - Ground Speed: 278 - Heading: 278>",
|
|
168
|
+
"<(GLID) OM-2709 - Altitude: 1236 - Ground Speed: 1 - Heading: 1>",
|
|
169
|
+
"<(B763) N196FE - Altitude: 0 - Ground Speed: 0 - Heading: 0>",
|
|
170
|
+
"<(B77L) N869FD - Altitude: 0 - Ground Speed: 0 - Heading: 0>",
|
|
171
|
+
"<(B763) N111FE - Altitude: 0 - Ground Speed: 0 - Heading: 0>",
|
|
172
|
+
"<(B763) N193FE - Altitude: 0 - Ground Speed: 0 - Heading: 0>",
|
|
173
|
+
# ...
|
|
151
174
|
]
|
|
152
175
|
```
|
|
153
176
|
|
|
177
|
+
### Flight Details
|
|
154
178
|
|
|
179
|
+
Get detailed information about a specific flight.
|
|
155
180
|
|
|
156
|
-
### Flight Details
|
|
157
181
|
```ruby
|
|
158
182
|
flight_id = FlightRadar.flights.sample.id
|
|
159
183
|
FlightRadar.flight_details(flight_id)
|
|
160
184
|
```
|
|
161
185
|
|
|
162
186
|
**Sample response:**
|
|
187
|
+
|
|
163
188
|
```ruby
|
|
164
189
|
{
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
190
|
+
"identification" => {
|
|
191
|
+
"id" => "2aaadc48",
|
|
192
|
+
"row" => 5175915984,
|
|
193
|
+
"number" => {
|
|
194
|
+
"default" => "F980",
|
|
195
|
+
"alternative" => nil
|
|
196
|
+
},
|
|
197
|
+
"callsign" => "FFT80"
|
|
198
|
+
},
|
|
199
|
+
"status" => {
|
|
200
|
+
"live" => true,
|
|
201
|
+
"text" => "Estimated- 14:01",
|
|
202
|
+
"icon" => "green",
|
|
203
|
+
"estimated" => nil,
|
|
204
|
+
"ambiguous" => false,
|
|
205
|
+
"generic" => {
|
|
206
|
+
"status" => {
|
|
207
|
+
"text" => "estimated",
|
|
208
|
+
"color" => "green",
|
|
209
|
+
"type" => "arrival"
|
|
171
210
|
},
|
|
172
|
-
"
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
"live""=>true",
|
|
176
|
-
"text""=>""Estimated- 14:01",
|
|
177
|
-
"icon""=>""green",
|
|
178
|
-
"estimated""=>nil",
|
|
179
|
-
"ambiguous""=>false",
|
|
180
|
-
"generic""=>"{
|
|
181
|
-
"status""=>"{
|
|
182
|
-
"text""=>""estimated",
|
|
183
|
-
"color""=>""green",
|
|
184
|
-
"type""=>""arrival"
|
|
185
|
-
},
|
|
186
|
-
"eventTime""=>"{
|
|
187
|
-
"utc"=>1643652087,
|
|
188
|
-
"local"=>1643637687
|
|
189
|
-
}
|
|
211
|
+
"eventTime" => {
|
|
212
|
+
"utc" => 1643652087,
|
|
213
|
+
"local" => 1643637687
|
|
190
214
|
}
|
|
191
|
-
|
|
192
|
-
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
# ...
|
|
193
218
|
}
|
|
194
219
|
```
|
|
195
220
|
|
|
221
|
+
### Flight Playback
|
|
222
|
+
|
|
223
|
+
Get playback data for a specific flight (includes full flight path history).
|
|
224
|
+
|
|
225
|
+
```ruby
|
|
226
|
+
flight_id = FlightRadar.flights.sample.id
|
|
227
|
+
FlightRadar.flight_playback(flight_id)
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
**Note:** This is an alias for `flight_details` and returns the same data structure.
|
|
231
|
+
|
|
196
232
|
### Flights by airline
|
|
233
|
+
|
|
197
234
|
```ruby
|
|
198
235
|
airline = "LOT"
|
|
199
236
|
FlightRadar.flights(airline: airline)
|
|
200
237
|
```
|
|
201
238
|
|
|
202
239
|
**Sample response:**
|
|
240
|
+
|
|
203
241
|
```ruby
|
|
204
242
|
[
|
|
205
|
-
"<(B789) SP-LSG - Altitude
|
|
206
|
-
"<(B788) SP-LRA - Altitude
|
|
207
|
-
"<(B788) SP-LRB - Altitude
|
|
208
|
-
"<(E195) SP-LNF - Altitude
|
|
209
|
-
"<(B38M) SP-LVF - Altitude
|
|
210
|
-
"<(E195) SP-LNB - Altitude
|
|
211
|
-
"<(B789) SP-LSF - Altitude
|
|
212
|
-
|
|
243
|
+
"<(B789) SP-LSG - Altitude: 39992 - Ground Speed: 451 - Heading: 451>",
|
|
244
|
+
"<(B788) SP-LRA - Altitude: 38975 - Ground Speed: 537 - Heading: 537>",
|
|
245
|
+
"<(B788) SP-LRB - Altitude: 38000 - Ground Speed: 463 - Heading: 463>",
|
|
246
|
+
"<(E195) SP-LNF - Altitude: 31675 - Ground Speed: 420 - Heading: 420>",
|
|
247
|
+
"<(B38M) SP-LVF - Altitude: 38000 - Ground Speed: 460 - Heading: 460>",
|
|
248
|
+
"<(E195) SP-LNB - Altitude: 22475 - Ground Speed: 366 - Heading: 366>",
|
|
249
|
+
"<(B789) SP-LSF - Altitude: 36000 - Ground Speed: 440 - Heading: 440>",
|
|
250
|
+
# ...
|
|
213
251
|
]
|
|
214
252
|
```
|
|
215
253
|
|
|
216
254
|
### Flights by bounds
|
|
255
|
+
|
|
217
256
|
```ruby
|
|
218
257
|
zone = FlightRadar.zones["oceania"]
|
|
219
258
|
bounds = FlightRadar.bounds(zone)
|
|
@@ -221,45 +260,144 @@ FlightRadar.flights(bounds: bounds)
|
|
|
221
260
|
```
|
|
222
261
|
|
|
223
262
|
**Sample response:**
|
|
263
|
+
|
|
224
264
|
```ruby
|
|
225
265
|
[
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
266
|
+
"<(B788) VT-ANP - Altitude: 41000 - Ground Speed: 494 - Heading: 494>",
|
|
267
|
+
"<(B738) VT-AXZ - Altitude: 37000 - Ground Speed: 436 - Heading: 436>",
|
|
268
|
+
"<(B772) PH-BQA - Altitude: 32000 - Ground Speed: 496 - Heading: 496>",
|
|
269
|
+
"<(A388) 9V-SKS - Altitude: 33996 - Ground Speed: 498 - Heading: 498>",
|
|
270
|
+
"<(B77L) A7-BFY - Altitude: 32000 - Ground Speed: 478 - Heading: 478>",
|
|
271
|
+
"<(B78X) 9V-SCA - Altitude: 38996 - Ground Speed: 514 - Heading: 514>",
|
|
272
|
+
"<(B77W) A6-ENU - Altitude: 34000 - Ground Speed: 504 - Heading: 504>",
|
|
273
|
+
"<(A359) OH-LWF - Altitude: 40004 - Ground Speed: 476 - Heading: 476>",
|
|
274
|
+
# ...
|
|
235
275
|
]
|
|
236
276
|
```
|
|
237
277
|
|
|
238
278
|
|
|
239
279
|
### Airline logo
|
|
280
|
+
|
|
240
281
|
```ruby
|
|
241
282
|
iata = "TK"
|
|
242
283
|
icao = "THY"
|
|
243
|
-
FlightRadar.
|
|
284
|
+
FlightRadar.airline_logo(iata, icao)
|
|
244
285
|
```
|
|
245
286
|
|
|
246
287
|
**Sample response:**
|
|
288
|
+
|
|
247
289
|
```ruby
|
|
248
|
-
[
|
|
290
|
+
%w[https://cdn.flightradar24.com/assets/airlines/logotypes/TK_THY.png https://www.flightradar24.com/static/images/data/operators/THY_logo0.png]
|
|
249
291
|
```
|
|
250
292
|
|
|
251
293
|
|
|
252
294
|
### Country flag
|
|
295
|
+
|
|
296
|
+
Get the URL of a country flag image.
|
|
297
|
+
|
|
253
298
|
```ruby
|
|
254
299
|
FlightRadar.country_flag("Poland")
|
|
255
300
|
```
|
|
256
301
|
|
|
257
302
|
**Sample response:**
|
|
303
|
+
|
|
258
304
|
```ruby
|
|
259
305
|
"https://www.flightradar24.com/static/images/data/flags-small/poland.gif"
|
|
260
306
|
```
|
|
261
307
|
|
|
308
|
+
### Search
|
|
309
|
+
|
|
310
|
+
Search for flights, airports, and airlines.
|
|
311
|
+
|
|
312
|
+
```ruby
|
|
313
|
+
FlightRadar.search("LOT", 10)
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
**Sample response:**
|
|
317
|
+
|
|
318
|
+
```ruby
|
|
319
|
+
{
|
|
320
|
+
"results" => [
|
|
321
|
+
{
|
|
322
|
+
"id" => "LOT",
|
|
323
|
+
"label" => "LOT (LOT / LO)",
|
|
324
|
+
"detail" => {
|
|
325
|
+
"operator_id" => 11,
|
|
326
|
+
"iata" => "LO",
|
|
327
|
+
"logo" => "https://cdn.flightradar24.com/assets/airlines/logotypes/11.png"
|
|
328
|
+
},
|
|
329
|
+
"type" => "operator",
|
|
330
|
+
"match" => "icao",
|
|
331
|
+
"name" => "LOT"
|
|
332
|
+
},
|
|
333
|
+
# ...
|
|
334
|
+
],
|
|
335
|
+
"stats" => {
|
|
336
|
+
"total" => {
|
|
337
|
+
"all" => 42,
|
|
338
|
+
"airport" => 12,
|
|
339
|
+
"operator" => 15,
|
|
340
|
+
"live" => 8
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
### Most Tracked Flights
|
|
347
|
+
|
|
348
|
+
Get the most tracked flights in real-time.
|
|
349
|
+
|
|
350
|
+
```ruby
|
|
351
|
+
FlightRadar.most_tracked
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
**Sample response:**
|
|
355
|
+
|
|
356
|
+
```ruby
|
|
357
|
+
{
|
|
358
|
+
"data" => [
|
|
359
|
+
{
|
|
360
|
+
"flight_id" => "2abc1234",
|
|
361
|
+
"flight" => "AA100",
|
|
362
|
+
"callsign" => "AAL100",
|
|
363
|
+
"squawk" => "1234",
|
|
364
|
+
"clicks" => 5420,
|
|
365
|
+
# ...
|
|
366
|
+
},
|
|
367
|
+
# ...
|
|
368
|
+
],
|
|
369
|
+
"update_time" => 1700000000,
|
|
370
|
+
"version" => 1
|
|
371
|
+
}
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
### Aircraft Information
|
|
375
|
+
|
|
376
|
+
Search for aircraft by registration number.
|
|
377
|
+
|
|
378
|
+
```ruby
|
|
379
|
+
FlightRadar.aircraft("N12345")
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
**Sample response:**
|
|
383
|
+
|
|
384
|
+
Returns search results similar to the `search` method, filtered for aircraft.
|
|
385
|
+
|
|
386
|
+
### Airline Fleet
|
|
387
|
+
|
|
388
|
+
Get fleet information for a specific airline.
|
|
389
|
+
|
|
390
|
+
```ruby
|
|
391
|
+
FlightRadar.airline_fleet("LOT")
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
**Sample response:**
|
|
395
|
+
|
|
396
|
+
Returns search results similar to the `search` method, showing airline and aircraft information.
|
|
397
|
+
|
|
398
|
+
## Documentation
|
|
262
399
|
|
|
400
|
+
Live documentation of the gem is available [at this GitHub page](https://kupolak.github.io/flight_radar/).
|
|
263
401
|
|
|
264
402
|
## Development
|
|
265
403
|
|
data/Rakefile
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require
|
|
4
|
-
require
|
|
3
|
+
require 'bundler/gem_tasks'
|
|
4
|
+
require 'rspec/core/rake_task'
|
|
5
5
|
|
|
6
6
|
RSpec::Core::RakeTask.new(:spec)
|
|
7
7
|
|
|
8
|
-
require
|
|
8
|
+
require 'rubocop/rake_task'
|
|
9
9
|
|
|
10
10
|
RuboCop::RakeTask.new
|
|
11
11
|
|