flight_radar 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +30 -0
- data/.gitignore +2 -1
- data/.rspec +0 -0
- data/.rubocop.yml +0 -0
- data/CHANGELOG.md +8 -0
- data/CODE_OF_CONDUCT.md +0 -0
- data/Gemfile +0 -8
- data/LICENSE.txt +1 -1
- data/README.md +8 -8
- data/Rakefile +0 -0
- data/flight_radar.gemspec +6 -3
- data/lib/flight_radar/core.rb +59 -44
- data/lib/flight_radar/flight.rb +0 -0
- data/lib/flight_radar/request.rb +0 -0
- data/lib/flight_radar.rb +3 -2
- metadata +51 -9
- data/Gemfile.lock +0 -64
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51bece5148b583b098a6821b34c81bb4e8412023f20288133668e420872d4a02
|
4
|
+
data.tar.gz: cee75c30c0d41a9da385a0efeeeca33ba8c1c0aae7f30e075408a1e49581a40e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 701fe16b782798feda39119cc70149266a94922315c9784328e74d6e3254aac70dd8f795d20fb0320c93d0bbccd2652f2444cd29b486874b6b3652d121dcdf3b
|
7
|
+
data.tar.gz: 3478f53760cc3478b4c4645e66eacf7e45075f315a79b04b086a2ca575202fb53d203926e4bf5953fa450446dda3e631e7e6bcd8afd59ce7d6c50248d77f3a57
|
@@ -0,0 +1,30 @@
|
|
1
|
+
name: Ruby
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- main
|
7
|
+
pull_request:
|
8
|
+
branches:
|
9
|
+
- main
|
10
|
+
|
11
|
+
jobs:
|
12
|
+
test:
|
13
|
+
runs-on: ubuntu-latest
|
14
|
+
|
15
|
+
steps:
|
16
|
+
- name: Checkout code
|
17
|
+
uses: actions/checkout@v2
|
18
|
+
|
19
|
+
- name: Set up Ruby and install dependencies
|
20
|
+
uses: ruby/setup-ruby@v1
|
21
|
+
with:
|
22
|
+
ruby-version: 3.0
|
23
|
+
|
24
|
+
- name: Install dependencies
|
25
|
+
run: |
|
26
|
+
gem install bundler
|
27
|
+
bundle install
|
28
|
+
|
29
|
+
- name: Run RSpec tests
|
30
|
+
run: bundle exec rake spec
|
data/.gitignore
CHANGED
data/.rspec
CHANGED
File without changes
|
data/.rubocop.yml
CHANGED
File without changes
|
data/CHANGELOG.md
CHANGED
data/CODE_OF_CONDUCT.md
CHANGED
File without changes
|
data/Gemfile
CHANGED
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
<img src="https://www.flightradar24.com/blog/wp-content/uploads/2020/04/Hi_Res_Transparent-2.jpg" width="200"/>
|
2
2
|
|
3
3
|
|
4
4
|
**Fetch aircraft data from Flightradar24.**
|
@@ -27,7 +27,7 @@ Or install it yourself as:
|
|
27
27
|
FlightRadar.airlines
|
28
28
|
```
|
29
29
|
**Sample response:**
|
30
|
-
```
|
30
|
+
```ruby
|
31
31
|
[
|
32
32
|
{"Name"=>"21 Air", "Code"=>"2I", "ICAO"=>"CSB"},
|
33
33
|
{"Name"=>"25Only Aviation", "Code"=>"", "ICAO"=>"ONY"},
|
@@ -73,7 +73,7 @@ airport = "LAX"
|
|
73
73
|
FlightRadar.airports
|
74
74
|
```
|
75
75
|
**Sample response:**
|
76
|
-
```
|
76
|
+
```ruby
|
77
77
|
[
|
78
78
|
{
|
79
79
|
"name""=>""A Coruna Airport",
|
@@ -102,7 +102,7 @@ FlightRadar.airports
|
|
102
102
|
FlightRadar.zones
|
103
103
|
```
|
104
104
|
**Sample response:**
|
105
|
-
```
|
105
|
+
```ruby
|
106
106
|
{
|
107
107
|
"europe""=>"{
|
108
108
|
"tl_y"=>72.57,
|
@@ -134,7 +134,7 @@ FlightRadar.flights
|
|
134
134
|
```
|
135
135
|
|
136
136
|
**Sample response:**
|
137
|
-
```
|
137
|
+
```ruby
|
138
138
|
[
|
139
139
|
"<(GRND) - Altitude":"0 - Ground Speed":"146 - Heading":146>,
|
140
140
|
"<(DRON) TEST4A - Altitude":"374 - Ground Speed":"1 - Heading":1>,
|
@@ -160,7 +160,7 @@ FlightRadar.flight_details(flight_id)
|
|
160
160
|
```
|
161
161
|
|
162
162
|
**Sample response:**
|
163
|
-
```
|
163
|
+
```ruby
|
164
164
|
{
|
165
165
|
"identification""=>"{
|
166
166
|
"id""=>""2aaadc48",
|
@@ -200,7 +200,7 @@ FlightRadar.flights(airline: airline)
|
|
200
200
|
```
|
201
201
|
|
202
202
|
**Sample response:**
|
203
|
-
```
|
203
|
+
```ruby
|
204
204
|
[
|
205
205
|
"<(B789) SP-LSG - Altitude":"39992 - Ground Speed":"451 - Heading":451>,
|
206
206
|
"<(B788) SP-LRA - Altitude":"38975 - Ground Speed":"537 - Heading":537>,
|
@@ -275,4 +275,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
275
275
|
|
276
276
|
## Code of Conduct
|
277
277
|
|
278
|
-
Everyone interacting in the FlightRadar project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/
|
278
|
+
Everyone interacting in the FlightRadar project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/kupolak/flight_radar/blob/main/CODE_OF_CONDUCT.md).
|
data/Rakefile
CHANGED
File without changes
|
data/flight_radar.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = "flight_radar"
|
5
|
-
spec.version = "0.
|
5
|
+
spec.version = "0.2.0"
|
6
6
|
spec.authors = ["Jakub Polak"]
|
7
7
|
spec.email = ["jakub.polak.vz@gmail.com"]
|
8
8
|
|
@@ -12,7 +12,6 @@ Gem::Specification.new do |spec|
|
|
12
12
|
spec.license = "MIT"
|
13
13
|
spec.required_ruby_version = ">= 2.7.0"
|
14
14
|
|
15
|
-
|
16
15
|
spec.metadata["homepage_uri"] = spec.homepage
|
17
16
|
spec.metadata["source_code_uri"] = "https://github.com/kupolak/flight_radar"
|
18
17
|
spec.metadata["changelog_uri"] = "https://github.com/kupolak/flight_radar/blob/main/CHANGELOG.md"
|
@@ -26,5 +25,9 @@ Gem::Specification.new do |spec|
|
|
26
25
|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
27
26
|
spec.require_paths = ["lib"]
|
28
27
|
|
29
|
-
spec.add_dependency "httparty", "~> 0.
|
28
|
+
spec.add_dependency "httparty", "~> 0.21.0"
|
29
|
+
|
30
|
+
spec.add_development_dependency "rake", "~>13.1.0"
|
31
|
+
spec.add_development_dependency "rspec", "~>3.12.0"
|
32
|
+
spec.add_development_dependency "rubocop", "~>1.59.0"
|
30
33
|
end
|
data/lib/flight_radar/core.rb
CHANGED
@@ -1,44 +1,59 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
#
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
#
|
15
|
-
|
16
|
-
|
17
|
-
#
|
18
|
-
|
19
|
-
|
20
|
-
#
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Core
|
4
|
+
API_FLIGHT_RADAR_BASE_URL = "https://api.flightradar24.com/common/v1"
|
5
|
+
CDN_FLIGHT_RADAR_BASE_URL = "https://cdn.flightradar24.com"
|
6
|
+
FLIGHT_RADAR_BASE_URL = "https://www.flightradar24.com"
|
7
|
+
DATA_LIVE_BASE_URL = "https://data-live.flightradar24.com"
|
8
|
+
DATA_CLOUD_BASE_URL = "https://data-cloud.flightradar24.com"
|
9
|
+
|
10
|
+
# User login URL.
|
11
|
+
USER_LOGIN_URL = "#{FLIGHT_RADAR_BASE_URL}/user/login"
|
12
|
+
USER_LOGOUT_URL = "#{FLIGHT_RADAR_BASE_URL}/user/logout"
|
13
|
+
|
14
|
+
# Most tracked data URL
|
15
|
+
MOST_TRACKED_URL = "#{FLIGHT_RADAR_BASE_URL}/flights/most-tracked"
|
16
|
+
|
17
|
+
# Search data URL
|
18
|
+
SEARCH_DATA_URL = "#{FLIGHT_RADAR_BASE_URL}/v1/search/web/find?query={}&limit=50"
|
19
|
+
|
20
|
+
# Flights data URLs.
|
21
|
+
REAL_TIME_FLIGHT_TRACKER_DATA_URL = "#{DATA_CLOUD_BASE_URL}/zones/fcgi/feed.js"
|
22
|
+
FLIGHT_DATA_URL = "#{DATA_LIVE_BASE_URL}/clickhandler/?flight={}"
|
23
|
+
|
24
|
+
# Airports data URLs.
|
25
|
+
API_AIRPORT_DATA_URL = "#{API_FLIGHT_RADAR_BASE_URL}/airport.json"
|
26
|
+
AIRPORT_DATA_URL = "#{FLIGHT_RADAR_BASE_URL}/airports/traffic-stats/?airport="
|
27
|
+
AIRPORTS_DATA_URL = "#{FLIGHT_RADAR_BASE_URL}/_json/airports.php"
|
28
|
+
|
29
|
+
# Airlines data URL.
|
30
|
+
AIRLINES_DATA_URL = "#{FLIGHT_RADAR_BASE_URL}/_json/airlines.php"
|
31
|
+
|
32
|
+
# Zones data URL.
|
33
|
+
ZONES_DATA_URL = "#{FLIGHT_RADAR_BASE_URL}/js/zones.js.php"
|
34
|
+
|
35
|
+
# Country flag image URL.
|
36
|
+
COUNTRY_FLAG_URL = "#{FLIGHT_RADAR_BASE_URL}/static/images/data/flags-small/"
|
37
|
+
|
38
|
+
# Airline logo image URL.
|
39
|
+
AIRLINE_LOGO_URL = "#{CDN_FLIGHT_RADAR_BASE_URL}/assets/airlines/logotypes/"
|
40
|
+
ALTERNATIVE_AIRLINE_LOGO_URL = "#{FLIGHT_RADAR_BASE_URL}/static/images/data/operators/"
|
41
|
+
|
42
|
+
HEADERS = {
|
43
|
+
"accept-encoding": "gzip, br",
|
44
|
+
"accept-language": "pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7",
|
45
|
+
"cache-control": "max-age=0",
|
46
|
+
"origin": "#{FLIGHT_RADAR_BASE_URL}",
|
47
|
+
"referer": "#{FLIGHT_RADAR_BASE_URL}/",
|
48
|
+
"sec-fetch-dest": "empty",
|
49
|
+
"sec-fetch-mode": "cors",
|
50
|
+
"sec-fetch-site": "same-site",
|
51
|
+
"user-agent": "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36"
|
52
|
+
}
|
53
|
+
|
54
|
+
JSON_HEADERS = HEADERS
|
55
|
+
JSON_HEADERS["accept"] = "application/json"
|
56
|
+
|
57
|
+
IMAGE_HEADERS = HEADERS
|
58
|
+
IMAGE_HEADERS["accept"] = "image/gif, image/jpg, image/jpeg, image/png"
|
59
|
+
end
|
data/lib/flight_radar/flight.rb
CHANGED
File without changes
|
data/lib/flight_radar/request.rb
CHANGED
File without changes
|
data/lib/flight_radar.rb
CHANGED
@@ -6,7 +6,7 @@ require_relative "flight_radar/flight"
|
|
6
6
|
|
7
7
|
# FlightRadar module for sending requests to FlightRadar24 API
|
8
8
|
module FlightRadar
|
9
|
-
VERSION = "0.
|
9
|
+
VERSION = "0.2.0"
|
10
10
|
|
11
11
|
module_function
|
12
12
|
|
@@ -22,7 +22,8 @@ module FlightRadar
|
|
22
22
|
"estimated": "1",
|
23
23
|
"maxage": "14400",
|
24
24
|
"gliders": "1",
|
25
|
-
"stats": "1"
|
25
|
+
"stats": "1",
|
26
|
+
"limit": "5000"
|
26
27
|
}
|
27
28
|
|
28
29
|
def airlines
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flight_radar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jakub Polak
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-12-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -16,14 +16,56 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.21.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.21.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 13.1.0
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 13.1.0
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 3.12.0
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 3.12.0
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rubocop
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 1.59.0
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 1.59.0
|
27
69
|
description: 'To use this API see more information at: https://www.flightradar24.com/terms-and-conditions'
|
28
70
|
email:
|
29
71
|
- jakub.polak.vz@gmail.com
|
@@ -31,13 +73,13 @@ executables: []
|
|
31
73
|
extensions: []
|
32
74
|
extra_rdoc_files: []
|
33
75
|
files:
|
76
|
+
- ".github/workflows/ruby.yml"
|
34
77
|
- ".gitignore"
|
35
78
|
- ".rspec"
|
36
79
|
- ".rubocop.yml"
|
37
80
|
- CHANGELOG.md
|
38
81
|
- CODE_OF_CONDUCT.md
|
39
82
|
- Gemfile
|
40
|
-
- Gemfile.lock
|
41
83
|
- LICENSE.txt
|
42
84
|
- README.md
|
43
85
|
- Rakefile
|
@@ -53,7 +95,7 @@ metadata:
|
|
53
95
|
homepage_uri: https://github.com/kupolak/flight_radar
|
54
96
|
source_code_uri: https://github.com/kupolak/flight_radar
|
55
97
|
changelog_uri: https://github.com/kupolak/flight_radar/blob/main/CHANGELOG.md
|
56
|
-
post_install_message:
|
98
|
+
post_install_message:
|
57
99
|
rdoc_options: []
|
58
100
|
require_paths:
|
59
101
|
- lib
|
@@ -68,8 +110,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
68
110
|
- !ruby/object:Gem::Version
|
69
111
|
version: '0'
|
70
112
|
requirements: []
|
71
|
-
rubygems_version: 3.
|
72
|
-
signing_key:
|
113
|
+
rubygems_version: 3.4.16
|
114
|
+
signing_key:
|
73
115
|
specification_version: 4
|
74
116
|
summary: Ruby gem for fetching aircraft data from Flightradar24
|
75
117
|
test_files: []
|
data/Gemfile.lock
DELETED
@@ -1,64 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
flight_radar (0.1.0)
|
5
|
-
httparty (~> 0.17.3)
|
6
|
-
|
7
|
-
GEM
|
8
|
-
remote: https://rubygems.org/
|
9
|
-
specs:
|
10
|
-
ast (2.4.2)
|
11
|
-
diff-lcs (1.4.4)
|
12
|
-
httparty (0.17.3)
|
13
|
-
mime-types (~> 3.0)
|
14
|
-
multi_xml (>= 0.5.2)
|
15
|
-
mime-types (3.3.1)
|
16
|
-
mime-types-data (~> 3.2015)
|
17
|
-
mime-types-data (3.2021.0901)
|
18
|
-
multi_xml (0.6.0)
|
19
|
-
parallel (1.20.1)
|
20
|
-
parser (3.0.2.0)
|
21
|
-
ast (~> 2.4.1)
|
22
|
-
rainbow (3.0.0)
|
23
|
-
rake (13.0.6)
|
24
|
-
regexp_parser (2.1.1)
|
25
|
-
rexml (3.2.5)
|
26
|
-
rspec (3.10.0)
|
27
|
-
rspec-core (~> 3.10.0)
|
28
|
-
rspec-expectations (~> 3.10.0)
|
29
|
-
rspec-mocks (~> 3.10.0)
|
30
|
-
rspec-core (3.10.1)
|
31
|
-
rspec-support (~> 3.10.0)
|
32
|
-
rspec-expectations (3.10.1)
|
33
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
34
|
-
rspec-support (~> 3.10.0)
|
35
|
-
rspec-mocks (3.10.2)
|
36
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
37
|
-
rspec-support (~> 3.10.0)
|
38
|
-
rspec-support (3.10.2)
|
39
|
-
rubocop (1.18.4)
|
40
|
-
parallel (~> 1.10)
|
41
|
-
parser (>= 3.0.0.0)
|
42
|
-
rainbow (>= 2.2.2, < 4.0)
|
43
|
-
regexp_parser (>= 1.8, < 3.0)
|
44
|
-
rexml
|
45
|
-
rubocop-ast (>= 1.8.0, < 2.0)
|
46
|
-
ruby-progressbar (~> 1.7)
|
47
|
-
unicode-display_width (>= 1.4.0, < 3.0)
|
48
|
-
rubocop-ast (1.9.1)
|
49
|
-
parser (>= 3.0.1.1)
|
50
|
-
ruby-progressbar (1.11.0)
|
51
|
-
unicode-display_width (2.0.0)
|
52
|
-
|
53
|
-
PLATFORMS
|
54
|
-
x86_64-linux
|
55
|
-
|
56
|
-
DEPENDENCIES
|
57
|
-
flight_radar!
|
58
|
-
httparty
|
59
|
-
rake (~> 13.0)
|
60
|
-
rspec (~> 3.0)
|
61
|
-
rubocop (~> 1.7)
|
62
|
-
|
63
|
-
BUNDLED WITH
|
64
|
-
2.2.24
|