IPinfo 1.1.0 → 2.2.1
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/workflows/cd_rubygems.yaml +3 -0
- data/.github/workflows/unittest.yaml +7 -3
- data/.ruby-version +1 -1
- data/README.md +18 -20
- data/ipinfo.gemspec +9 -1
- data/lib/ipinfo/adapter.rb +9 -6
- data/lib/ipinfo/countriesData.rb +1045 -0
- data/lib/ipinfo/version.rb +1 -1
- data/lib/ipinfo.rb +47 -62
- metadata +89 -9
- data/lib/ipinfo/continent.json +0 -252
- data/lib/ipinfo/countries.json +0 -1
- data/lib/ipinfo/currency.json +0 -253
- data/lib/ipinfo/eu.json +0 -1
- data/lib/ipinfo/flags.json +0 -252
data/lib/ipinfo/version.rb
CHANGED
data/lib/ipinfo.rb
CHANGED
@@ -9,27 +9,18 @@ require 'ipinfo/response'
|
|
9
9
|
require 'ipinfo/version'
|
10
10
|
require 'json'
|
11
11
|
require_relative 'ipinfo/ipAddressMatcher'
|
12
|
+
require_relative 'ipinfo/countriesData'
|
12
13
|
|
13
14
|
module IPinfo
|
15
|
+
include CountriesData
|
14
16
|
DEFAULT_CACHE_MAXSIZE = 4096
|
15
17
|
DEFAULT_CACHE_TTL = 60 * 60 * 24
|
16
|
-
DEFAULT_COUNTRY_FILE = File.join(File.dirname(__FILE__),
|
17
|
-
'ipinfo/countries.json')
|
18
|
-
DEFAULT_EU_COUNTRIES_FILE = File.join(File.dirname(__FILE__),
|
19
|
-
'ipinfo/eu.json')
|
20
|
-
DEFAULT_COUNTRIES_FLAG_FILE = File.join(File.dirname(__FILE__),
|
21
|
-
'ipinfo/flags.json')
|
22
|
-
DEFAULT_COUNTRIES_CURRENCIES_FILE = File.join(File.dirname(__FILE__),
|
23
|
-
'ipinfo/currency.json')
|
24
|
-
DEFAULT_CONTINENT_FILE = File.join(File.dirname(__FILE__),
|
25
|
-
'ipinfo/continent.json')
|
26
18
|
RATE_LIMIT_MESSAGE = 'To increase your limits, please review our ' \
|
27
19
|
'paid plans at https://ipinfo.io/pricing'
|
28
20
|
# Base URL to get country flag image link.
|
29
21
|
# "PK" -> "https://cdn.ipinfo.io/static/images/countries-flags/PK.svg"
|
30
22
|
COUNTRY_FLAGS_URL = "https://cdn.ipinfo.io/static/images/countries-flags/"
|
31
23
|
|
32
|
-
|
33
24
|
class << self
|
34
25
|
def create(access_token = nil, settings = {})
|
35
26
|
IPinfo.new(access_token, settings)
|
@@ -43,51 +34,24 @@ class IPinfo::IPinfo
|
|
43
34
|
|
44
35
|
def initialize(access_token = nil, settings = {})
|
45
36
|
@access_token = access_token
|
46
|
-
|
37
|
+
prepare_http_client(settings.fetch('http_client', nil))
|
47
38
|
|
48
39
|
maxsize = settings.fetch('maxsize', DEFAULT_CACHE_MAXSIZE)
|
49
40
|
ttl = settings.fetch('ttl', DEFAULT_CACHE_TTL)
|
50
41
|
@cache = settings.fetch('cache', DefaultCache.new(ttl, maxsize))
|
51
|
-
@countries =
|
52
|
-
|
53
|
-
@
|
54
|
-
|
55
|
-
@
|
56
|
-
DEFAULT_COUNTRIES_FLAG_FILE))
|
57
|
-
@countries_currencies = prepare_json(settings.fetch('countries_currencies',
|
58
|
-
DEFAULT_COUNTRIES_CURRENCIES_FILE))
|
59
|
-
@continents = prepare_json(settings.fetch('continents',
|
60
|
-
DEFAULT_CONTINENT_FILE))
|
42
|
+
@countries = settings.fetch('countries', DEFAULT_COUNTRY_LIST)
|
43
|
+
@eu_countries = settings.fetch('eu_countries', DEFAULT_EU_COUNTRIES_LIST)
|
44
|
+
@countries_flags = settings.fetch('countries_flags', DEFAULT_COUNTRIES_FLAG_LIST)
|
45
|
+
@countries_currencies = settings.fetch('countries_currencies', DEFAULT_COUNTRIES_CURRENCIES_LIST)
|
46
|
+
@continents = settings.fetch('continents', DEFAULT_CONTINENT_LIST)
|
61
47
|
end
|
62
48
|
|
63
49
|
def details(ip_address = nil)
|
64
|
-
|
65
|
-
|
66
|
-
details[:country_name] =
|
67
|
-
@countries.fetch(details.fetch(:country), nil)
|
68
|
-
details[:is_eu] =
|
69
|
-
@eu_countries.include?(details.fetch(:country))
|
70
|
-
details[:country_flag] =
|
71
|
-
@countries_flags.fetch(details.fetch(:country), nil)
|
72
|
-
details[:country_currency] =
|
73
|
-
@countries_currencies.fetch(details.fetch(:country), nil)
|
74
|
-
details[:continent] =
|
75
|
-
@continents.fetch(details.fetch(:country), nil)
|
76
|
-
details[:country_flag_url] = COUNTRY_FLAGS_URL + details.fetch(:country) + ".svg"
|
77
|
-
end
|
78
|
-
|
79
|
-
if details.key? :ip
|
80
|
-
details[:ip_address] =
|
81
|
-
IPAddr.new(details.fetch(:ip))
|
82
|
-
end
|
83
|
-
|
84
|
-
if details.key? :loc
|
85
|
-
loc = details.fetch(:loc).split(',')
|
86
|
-
details[:latitude] = loc[0]
|
87
|
-
details[:longitude] = loc[1]
|
88
|
-
end
|
50
|
+
details_base(ip_address, :v4)
|
51
|
+
end
|
89
52
|
|
90
|
-
|
53
|
+
def details_v6(ip_address = nil)
|
54
|
+
details_base(ip_address, :v6)
|
91
55
|
end
|
92
56
|
|
93
57
|
def get_map_url(ips)
|
@@ -147,7 +111,13 @@ class IPinfo::IPinfo
|
|
147
111
|
|
148
112
|
protected
|
149
113
|
|
150
|
-
def
|
114
|
+
def prepare_http_client(httpc = nil)
|
115
|
+
@httpc = Adapter.new(access_token, httpc || :net_http)
|
116
|
+
end
|
117
|
+
|
118
|
+
private
|
119
|
+
|
120
|
+
def request_details(ip_address = nil, host_type)
|
151
121
|
if isBogon(ip_address)
|
152
122
|
details[:ip] = ip_address
|
153
123
|
details[:bogon] = true
|
@@ -159,7 +129,7 @@ class IPinfo::IPinfo
|
|
159
129
|
res = @cache.get(cache_key(ip_address))
|
160
130
|
return res unless res.nil?
|
161
131
|
|
162
|
-
response = @httpc.get(escape_path(ip_address))
|
132
|
+
response = @httpc.get(escape_path(ip_address), host_type)
|
163
133
|
|
164
134
|
if response.status.eql?(429)
|
165
135
|
raise RateLimitError,
|
@@ -171,20 +141,35 @@ class IPinfo::IPinfo
|
|
171
141
|
details
|
172
142
|
end
|
173
143
|
|
174
|
-
def
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
144
|
+
def details_base(ip_address, host_type)
|
145
|
+
details = request_details(ip_address, host_type)
|
146
|
+
if details.key? :country
|
147
|
+
details[:country_name] =
|
148
|
+
@countries.fetch(details.fetch(:country), nil)
|
149
|
+
details[:is_eu] =
|
150
|
+
@eu_countries.include?(details.fetch(:country))
|
151
|
+
details[:country_flag] =
|
152
|
+
@countries_flags.fetch(details.fetch(:country), nil)
|
153
|
+
details[:country_currency] =
|
154
|
+
@countries_currencies.fetch(details.fetch(:country), nil)
|
155
|
+
details[:continent] =
|
156
|
+
@continents.fetch(details.fetch(:country), nil)
|
157
|
+
details[:country_flag_url] = COUNTRY_FLAGS_URL + details.fetch(:country) + ".svg"
|
158
|
+
end
|
181
159
|
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
160
|
+
if details.key? :ip
|
161
|
+
details[:ip_address] =
|
162
|
+
IPAddr.new(details.fetch(:ip))
|
163
|
+
end
|
186
164
|
|
187
|
-
|
165
|
+
if details.key? :loc
|
166
|
+
loc = details.fetch(:loc).split(',')
|
167
|
+
details[:latitude] = loc[0]
|
168
|
+
details[:longitude] = loc[1]
|
169
|
+
end
|
170
|
+
|
171
|
+
Response.new(details)
|
172
|
+
end
|
188
173
|
|
189
174
|
def isBogon(ip)
|
190
175
|
if ip.nil?
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: IPinfo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stanislav K, James Timmins
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2024-01-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faraday
|
@@ -17,14 +17,98 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: '
|
20
|
+
version: '2.0'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - "~>"
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '2.0'
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: async-http-faraday
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '0'
|
35
|
+
type: :development
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0'
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: faraday-net_http_persistent
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - "~>"
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '2.0'
|
49
|
+
type: :development
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - "~>"
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '2.0'
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: faraday-typhoeus
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
24
59
|
requirements:
|
25
60
|
- - "~>"
|
26
61
|
- !ruby/object:Gem::Version
|
27
62
|
version: '1.0'
|
63
|
+
type: :development
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - "~>"
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '1.0'
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: faraday-patron
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - "~>"
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '2.0'
|
77
|
+
type: :development
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - "~>"
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '2.0'
|
84
|
+
- !ruby/object:Gem::Dependency
|
85
|
+
name: faraday-httpclient
|
86
|
+
requirement: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - "~>"
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '2.0'
|
91
|
+
type: :development
|
92
|
+
prerelease: false
|
93
|
+
version_requirements: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - "~>"
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '2.0'
|
98
|
+
- !ruby/object:Gem::Dependency
|
99
|
+
name: faraday-excon
|
100
|
+
requirement: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - "~>"
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '2.1'
|
105
|
+
type: :development
|
106
|
+
prerelease: false
|
107
|
+
version_requirements: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - "~>"
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '2.1'
|
28
112
|
- !ruby/object:Gem::Dependency
|
29
113
|
name: json
|
30
114
|
requirement: !ruby/object:Gem::Requirement
|
@@ -78,12 +162,8 @@ files:
|
|
78
162
|
- lib/ipinfo/adapter.rb
|
79
163
|
- lib/ipinfo/cache/cache_interface.rb
|
80
164
|
- lib/ipinfo/cache/default_cache.rb
|
81
|
-
- lib/ipinfo/
|
82
|
-
- lib/ipinfo/countries.json
|
83
|
-
- lib/ipinfo/currency.json
|
165
|
+
- lib/ipinfo/countriesData.rb
|
84
166
|
- lib/ipinfo/errors.rb
|
85
|
-
- lib/ipinfo/eu.json
|
86
|
-
- lib/ipinfo/flags.json
|
87
167
|
- lib/ipinfo/ipAddressMatcher.rb
|
88
168
|
- lib/ipinfo/mod.rb
|
89
169
|
- lib/ipinfo/response.rb
|
@@ -106,7 +186,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
106
186
|
- !ruby/object:Gem::Version
|
107
187
|
version: '0'
|
108
188
|
requirements: []
|
109
|
-
rubygems_version: 3.
|
189
|
+
rubygems_version: 3.4.10
|
110
190
|
signing_key:
|
111
191
|
specification_version: 4
|
112
192
|
summary: This is a ruby wrapper for http://ipinfo.io.
|
data/lib/ipinfo/continent.json
DELETED
@@ -1,252 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"BD": {"code": "AS", "name": "Asia"},
|
3
|
-
"BE": {"code": "EU", "name": "Europe"},
|
4
|
-
"BF": {"code": "AF", "name": "Africa"},
|
5
|
-
"BG": {"code": "EU", "name": "Europe"},
|
6
|
-
"BA": {"code": "EU", "name": "Europe"},
|
7
|
-
"BB": {"code": "NA", "name": "North America"},
|
8
|
-
"WF": {"code": "OC", "name": "Oceania"},
|
9
|
-
"BL": {"code": "NA", "name": "North America"},
|
10
|
-
"BM": {"code": "NA", "name": "North America"},
|
11
|
-
"BN": {"code": "AS", "name": "Asia"},
|
12
|
-
"BO": {"code": "SA", "name": "South America"},
|
13
|
-
"BH": {"code": "AS", "name": "Asia"},
|
14
|
-
"BI": {"code": "AF", "name": "Africa"},
|
15
|
-
"BJ": {"code": "AF", "name": "Africa"},
|
16
|
-
"BT": {"code": "AS", "name": "Asia"},
|
17
|
-
"JM": {"code": "NA", "name": "North America"},
|
18
|
-
"BV": {"code": "AN", "name": "Antarctica"},
|
19
|
-
"BW": {"code": "AF", "name": "Africa"},
|
20
|
-
"WS": {"code": "OC", "name": "Oceania"},
|
21
|
-
"BQ": {"code": "NA", "name": "North America"},
|
22
|
-
"BR": {"code": "SA", "name": "South America"},
|
23
|
-
"BS": {"code": "NA", "name": "North America"},
|
24
|
-
"JE": {"code": "EU", "name": "Europe"},
|
25
|
-
"BY": {"code": "EU", "name": "Europe"},
|
26
|
-
"BZ": {"code": "NA", "name": "North America"},
|
27
|
-
"RU": {"code": "EU", "name": "Europe"},
|
28
|
-
"RW": {"code": "AF", "name": "Africa"},
|
29
|
-
"RS": {"code": "EU", "name": "Europe"},
|
30
|
-
"TL": {"code": "OC", "name": "Oceania"},
|
31
|
-
"RE": {"code": "AF", "name": "Africa"},
|
32
|
-
"TM": {"code": "AS", "name": "Asia"},
|
33
|
-
"TJ": {"code": "AS", "name": "Asia"},
|
34
|
-
"RO": {"code": "EU", "name": "Europe"},
|
35
|
-
"TK": {"code": "OC", "name": "Oceania"},
|
36
|
-
"GW": {"code": "AF", "name": "Africa"},
|
37
|
-
"GU": {"code": "OC", "name": "Oceania"},
|
38
|
-
"GT": {"code": "NA", "name": "North America"},
|
39
|
-
"GS": {"code": "AN", "name": "Antarctica"},
|
40
|
-
"GR": {"code": "EU", "name": "Europe"},
|
41
|
-
"GQ": {"code": "AF", "name": "Africa"},
|
42
|
-
"GP": {"code": "NA", "name": "North America"},
|
43
|
-
"JP": {"code": "AS", "name": "Asia"},
|
44
|
-
"GY": {"code": "SA", "name": "South America"},
|
45
|
-
"GG": {"code": "EU", "name": "Europe"},
|
46
|
-
"GF": {"code": "SA", "name": "South America"},
|
47
|
-
"GE": {"code": "AS", "name": "Asia"},
|
48
|
-
"GD": {"code": "NA", "name": "North America"},
|
49
|
-
"GB": {"code": "EU", "name": "Europe"},
|
50
|
-
"GA": {"code": "AF", "name": "Africa"},
|
51
|
-
"SV": {"code": "NA", "name": "North America"},
|
52
|
-
"GN": {"code": "AF", "name": "Africa"},
|
53
|
-
"GM": {"code": "AF", "name": "Africa"},
|
54
|
-
"GL": {"code": "NA", "name": "North America"},
|
55
|
-
"GI": {"code": "EU", "name": "Europe"},
|
56
|
-
"GH": {"code": "AF", "name": "Africa"},
|
57
|
-
"OM": {"code": "AS", "name": "Asia"},
|
58
|
-
"TN": {"code": "AF", "name": "Africa"},
|
59
|
-
"JO": {"code": "AS", "name": "Asia"},
|
60
|
-
"HR": {"code": "EU", "name": "Europe"},
|
61
|
-
"HT": {"code": "NA", "name": "North America"},
|
62
|
-
"HU": {"code": "EU", "name": "Europe"},
|
63
|
-
"HK": {"code": "AS", "name": "Asia"},
|
64
|
-
"HN": {"code": "NA", "name": "North America"},
|
65
|
-
"HM": {"code": "AN", "name": "Antarctica"},
|
66
|
-
"VE": {"code": "SA", "name": "South America"},
|
67
|
-
"PR": {"code": "NA", "name": "North America"},
|
68
|
-
"PS": {"code": "AS", "name": "Asia"},
|
69
|
-
"PW": {"code": "OC", "name": "Oceania"},
|
70
|
-
"PT": {"code": "EU", "name": "Europe"},
|
71
|
-
"SJ": {"code": "EU", "name": "Europe"},
|
72
|
-
"PY": {"code": "SA", "name": "South America"},
|
73
|
-
"IQ": {"code": "AS", "name": "Asia"},
|
74
|
-
"PA": {"code": "NA", "name": "North America"},
|
75
|
-
"PF": {"code": "OC", "name": "Oceania"},
|
76
|
-
"PG": {"code": "OC", "name": "Oceania"},
|
77
|
-
"PE": {"code": "SA", "name": "South America"},
|
78
|
-
"PK": {"code": "AS", "name": "Asia"},
|
79
|
-
"PH": {"code": "AS", "name": "Asia"},
|
80
|
-
"PN": {"code": "OC", "name": "Oceania"},
|
81
|
-
"PL": {"code": "EU", "name": "Europe"},
|
82
|
-
"PM": {"code": "NA", "name": "North America"},
|
83
|
-
"ZM": {"code": "AF", "name": "Africa"},
|
84
|
-
"EH": {"code": "AF", "name": "Africa"},
|
85
|
-
"EE": {"code": "EU", "name": "Europe"},
|
86
|
-
"EG": {"code": "AF", "name": "Africa"},
|
87
|
-
"ZA": {"code": "AF", "name": "Africa"},
|
88
|
-
"EC": {"code": "SA", "name": "South America"},
|
89
|
-
"IT": {"code": "EU", "name": "Europe"},
|
90
|
-
"VN": {"code": "AS", "name": "Asia"},
|
91
|
-
"SB": {"code": "OC", "name": "Oceania"},
|
92
|
-
"ET": {"code": "AF", "name": "Africa"},
|
93
|
-
"SO": {"code": "AF", "name": "Africa"},
|
94
|
-
"ZW": {"code": "AF", "name": "Africa"},
|
95
|
-
"SA": {"code": "AS", "name": "Asia"},
|
96
|
-
"ES": {"code": "EU", "name": "Europe"},
|
97
|
-
"ER": {"code": "AF", "name": "Africa"},
|
98
|
-
"ME": {"code": "EU", "name": "Europe"},
|
99
|
-
"MD": {"code": "EU", "name": "Europe"},
|
100
|
-
"MG": {"code": "AF", "name": "Africa"},
|
101
|
-
"MF": {"code": "NA", "name": "North America"},
|
102
|
-
"MA": {"code": "AF", "name": "Africa"},
|
103
|
-
"MC": {"code": "EU", "name": "Europe"},
|
104
|
-
"UZ": {"code": "AS", "name": "Asia"},
|
105
|
-
"MM": {"code": "AS", "name": "Asia"},
|
106
|
-
"ML": {"code": "AF", "name": "Africa"},
|
107
|
-
"MO": {"code": "AS", "name": "Asia"},
|
108
|
-
"MN": {"code": "AS", "name": "Asia"},
|
109
|
-
"MH": {"code": "OC", "name": "Oceania"},
|
110
|
-
"MK": {"code": "EU", "name": "Europe"},
|
111
|
-
"MU": {"code": "AF", "name": "Africa"},
|
112
|
-
"MT": {"code": "EU", "name": "Europe"},
|
113
|
-
"MW": {"code": "AF", "name": "Africa"},
|
114
|
-
"MV": {"code": "AS", "name": "Asia"},
|
115
|
-
"MQ": {"code": "NA", "name": "North America"},
|
116
|
-
"MP": {"code": "OC", "name": "Oceania"},
|
117
|
-
"MS": {"code": "NA", "name": "North America"},
|
118
|
-
"MR": {"code": "AF", "name": "Africa"},
|
119
|
-
"IM": {"code": "EU", "name": "Europe"},
|
120
|
-
"UG": {"code": "AF", "name": "Africa"},
|
121
|
-
"TZ": {"code": "AF", "name": "Africa"},
|
122
|
-
"MY": {"code": "AS", "name": "Asia"},
|
123
|
-
"MX": {"code": "NA", "name": "North America"},
|
124
|
-
"IL": {"code": "AS", "name": "Asia"},
|
125
|
-
"FR": {"code": "EU", "name": "Europe"},
|
126
|
-
"IO": {"code": "AS", "name": "Asia"},
|
127
|
-
"SH": {"code": "AF", "name": "Africa"},
|
128
|
-
"FI": {"code": "EU", "name": "Europe"},
|
129
|
-
"FJ": {"code": "OC", "name": "Oceania"},
|
130
|
-
"FK": {"code": "SA", "name": "South America"},
|
131
|
-
"FM": {"code": "OC", "name": "Oceania"},
|
132
|
-
"FO": {"code": "EU", "name": "Europe"},
|
133
|
-
"NI": {"code": "NA", "name": "North America"},
|
134
|
-
"NL": {"code": "EU", "name": "Europe"},
|
135
|
-
"NO": {"code": "EU", "name": "Europe"},
|
136
|
-
"NA": {"code": "AF", "name": "Africa"},
|
137
|
-
"VU": {"code": "OC", "name": "Oceania"},
|
138
|
-
"NC": {"code": "OC", "name": "Oceania"},
|
139
|
-
"NE": {"code": "AF", "name": "Africa"},
|
140
|
-
"NF": {"code": "OC", "name": "Oceania"},
|
141
|
-
"NG": {"code": "AF", "name": "Africa"},
|
142
|
-
"NZ": {"code": "OC", "name": "Oceania"},
|
143
|
-
"NP": {"code": "AS", "name": "Asia"},
|
144
|
-
"NR": {"code": "OC", "name": "Oceania"},
|
145
|
-
"NU": {"code": "OC", "name": "Oceania"},
|
146
|
-
"CK": {"code": "OC", "name": "Oceania"},
|
147
|
-
"XK": {"code": "EU", "name": "Europe"},
|
148
|
-
"CI": {"code": "AF", "name": "Africa"},
|
149
|
-
"CH": {"code": "EU", "name": "Europe"},
|
150
|
-
"CO": {"code": "SA", "name": "South America"},
|
151
|
-
"CN": {"code": "AS", "name": "Asia"},
|
152
|
-
"CM": {"code": "AF", "name": "Africa"},
|
153
|
-
"CL": {"code": "SA", "name": "South America"},
|
154
|
-
"CC": {"code": "AS", "name": "Asia"},
|
155
|
-
"CA": {"code": "NA", "name": "North America"},
|
156
|
-
"CG": {"code": "AF", "name": "Africa"},
|
157
|
-
"CF": {"code": "AF", "name": "Africa"},
|
158
|
-
"CD": {"code": "AF", "name": "Africa"},
|
159
|
-
"CZ": {"code": "EU", "name": "Europe"},
|
160
|
-
"CY": {"code": "EU", "name": "Europe"},
|
161
|
-
"CX": {"code": "AS", "name": "Asia"},
|
162
|
-
"CR": {"code": "NA", "name": "North America"},
|
163
|
-
"CW": {"code": "NA", "name": "North America"},
|
164
|
-
"CV": {"code": "AF", "name": "Africa"},
|
165
|
-
"CU": {"code": "NA", "name": "North America"},
|
166
|
-
"SZ": {"code": "AF", "name": "Africa"},
|
167
|
-
"SY": {"code": "AS", "name": "Asia"},
|
168
|
-
"SX": {"code": "NA", "name": "North America"},
|
169
|
-
"KG": {"code": "AS", "name": "Asia"},
|
170
|
-
"KE": {"code": "AF", "name": "Africa"},
|
171
|
-
"SS": {"code": "AF", "name": "Africa"},
|
172
|
-
"SR": {"code": "SA", "name": "South America"},
|
173
|
-
"KI": {"code": "OC", "name": "Oceania"},
|
174
|
-
"KH": {"code": "AS", "name": "Asia"},
|
175
|
-
"KN": {"code": "NA", "name": "North America"},
|
176
|
-
"KM": {"code": "AF", "name": "Africa"},
|
177
|
-
"ST": {"code": "AF", "name": "Africa"},
|
178
|
-
"SK": {"code": "EU", "name": "Europe"},
|
179
|
-
"KR": {"code": "AS", "name": "Asia"},
|
180
|
-
"SI": {"code": "EU", "name": "Europe"},
|
181
|
-
"KP": {"code": "AS", "name": "Asia"},
|
182
|
-
"KW": {"code": "AS", "name": "Asia"},
|
183
|
-
"SN": {"code": "AF", "name": "Africa"},
|
184
|
-
"SM": {"code": "EU", "name": "Europe"},
|
185
|
-
"SL": {"code": "AF", "name": "Africa"},
|
186
|
-
"SC": {"code": "AF", "name": "Africa"},
|
187
|
-
"KZ": {"code": "AS", "name": "Asia"},
|
188
|
-
"KY": {"code": "NA", "name": "North America"},
|
189
|
-
"SG": {"code": "AS", "name": "Asia"},
|
190
|
-
"SE": {"code": "EU", "name": "Europe"},
|
191
|
-
"SD": {"code": "AF", "name": "Africa"},
|
192
|
-
"DO": {"code": "NA", "name": "North America"},
|
193
|
-
"DM": {"code": "NA", "name": "North America"},
|
194
|
-
"DJ": {"code": "AF", "name": "Africa"},
|
195
|
-
"DK": {"code": "EU", "name": "Europe"},
|
196
|
-
"VG": {"code": "NA", "name": "North America"},
|
197
|
-
"DE": {"code": "EU", "name": "Europe"},
|
198
|
-
"YE": {"code": "AS", "name": "Asia"},
|
199
|
-
"DZ": {"code": "AF", "name": "Africa"},
|
200
|
-
"US": {"code": "NA", "name": "North America"},
|
201
|
-
"UY": {"code": "SA", "name": "South America"},
|
202
|
-
"YT": {"code": "AF", "name": "Africa"},
|
203
|
-
"UM": {"code": "OC", "name": "Oceania"},
|
204
|
-
"LB": {"code": "AS", "name": "Asia"},
|
205
|
-
"LC": {"code": "NA", "name": "North America"},
|
206
|
-
"LA": {"code": "AS", "name": "Asia"},
|
207
|
-
"TV": {"code": "OC", "name": "Oceania"},
|
208
|
-
"TW": {"code": "AS", "name": "Asia"},
|
209
|
-
"TT": {"code": "NA", "name": "North America"},
|
210
|
-
"TR": {"code": "AS", "name": "Asia"},
|
211
|
-
"LK": {"code": "AS", "name": "Asia"},
|
212
|
-
"LI": {"code": "EU", "name": "Europe"},
|
213
|
-
"LV": {"code": "EU", "name": "Europe"},
|
214
|
-
"TO": {"code": "OC", "name": "Oceania"},
|
215
|
-
"LT": {"code": "EU", "name": "Europe"},
|
216
|
-
"LU": {"code": "EU", "name": "Europe"},
|
217
|
-
"LR": {"code": "AF", "name": "Africa"},
|
218
|
-
"LS": {"code": "AF", "name": "Africa"},
|
219
|
-
"TH": {"code": "AS", "name": "Asia"},
|
220
|
-
"TF": {"code": "AN", "name": "Antarctica"},
|
221
|
-
"TG": {"code": "AF", "name": "Africa"},
|
222
|
-
"TD": {"code": "AF", "name": "Africa"},
|
223
|
-
"TC": {"code": "NA", "name": "North America"},
|
224
|
-
"LY": {"code": "AF", "name": "Africa"},
|
225
|
-
"VA": {"code": "EU", "name": "Europe"},
|
226
|
-
"VC": {"code": "NA", "name": "North America"},
|
227
|
-
"AE": {"code": "AS", "name": "Asia"},
|
228
|
-
"AD": {"code": "EU", "name": "Europe"},
|
229
|
-
"AG": {"code": "NA", "name": "North America"},
|
230
|
-
"AF": {"code": "AS", "name": "Asia"},
|
231
|
-
"AI": {"code": "NA", "name": "North America"},
|
232
|
-
"VI": {"code": "NA", "name": "North America"},
|
233
|
-
"IS": {"code": "EU", "name": "Europe"},
|
234
|
-
"IR": {"code": "AS", "name": "Asia"},
|
235
|
-
"AM": {"code": "AS", "name": "Asia"},
|
236
|
-
"AL": {"code": "EU", "name": "Europe"},
|
237
|
-
"AO": {"code": "AF", "name": "Africa"},
|
238
|
-
"AQ": {"code": "AN", "name": "Antarctica"},
|
239
|
-
"AS": {"code": "OC", "name": "Oceania"},
|
240
|
-
"AR": {"code": "SA", "name": "South America"},
|
241
|
-
"AU": {"code": "OC", "name": "Oceania"},
|
242
|
-
"AT": {"code": "EU", "name": "Europe"},
|
243
|
-
"AW": {"code": "NA", "name": "North America"},
|
244
|
-
"IN": {"code": "AS", "name": "Asia"},
|
245
|
-
"AX": {"code": "EU", "name": "Europe"},
|
246
|
-
"AZ": {"code": "AS", "name": "Asia"},
|
247
|
-
"IE": {"code": "EU", "name": "Europe"},
|
248
|
-
"ID": {"code": "AS", "name": "Asia"},
|
249
|
-
"UA": {"code": "EU", "name": "Europe"},
|
250
|
-
"QA": {"code": "AS", "name": "Asia"},
|
251
|
-
"MZ": {"code": "AF", "name": "Africa"}
|
252
|
-
}
|
data/lib/ipinfo/countries.json
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"BD": "Bangladesh", "BE": "Belgium", "BF": "Burkina Faso", "BG": "Bulgaria", "BA": "Bosnia and Herzegovina", "BB": "Barbados", "WF": "Wallis and Futuna", "BL": "Saint Barthelemy", "BM": "Bermuda", "BN": "Brunei", "BO": "Bolivia", "BH": "Bahrain", "BI": "Burundi", "BJ": "Benin", "BT": "Bhutan", "JM": "Jamaica", "BV": "Bouvet Island", "BW": "Botswana", "WS": "Samoa", "BQ": "Bonaire, Saint Eustatius and Saba ", "BR": "Brazil", "BS": "Bahamas", "JE": "Jersey", "BY": "Belarus", "BZ": "Belize", "RU": "Russia", "RW": "Rwanda", "RS": "Serbia", "TL": "East Timor", "RE": "Reunion", "TM": "Turkmenistan", "TJ": "Tajikistan", "RO": "Romania", "TK": "Tokelau", "GW": "Guinea-Bissau", "GU": "Guam", "GT": "Guatemala", "GS": "South Georgia and the South Sandwich Islands", "GR": "Greece", "GQ": "Equatorial Guinea", "GP": "Guadeloupe", "JP": "Japan", "GY": "Guyana", "GG": "Guernsey", "GF": "French Guiana", "GE": "Georgia", "GD": "Grenada", "GB": "United Kingdom", "GA": "Gabon", "SV": "El Salvador", "GN": "Guinea", "GM": "Gambia", "GL": "Greenland", "GI": "Gibraltar", "GH": "Ghana", "OM": "Oman", "TN": "Tunisia", "JO": "Jordan", "HR": "Croatia", "HT": "Haiti", "HU": "Hungary", "HK": "Hong Kong", "HN": "Honduras", "HM": "Heard Island and McDonald Islands", "VE": "Venezuela", "PR": "Puerto Rico", "PS": "Palestinian Territory", "PW": "Palau", "PT": "Portugal", "SJ": "Svalbard and Jan Mayen", "PY": "Paraguay", "IQ": "Iraq", "PA": "Panama", "PF": "French Polynesia", "PG": "Papua New Guinea", "PE": "Peru", "PK": "Pakistan", "PH": "Philippines", "PN": "Pitcairn", "PL": "Poland", "PM": "Saint Pierre and Miquelon", "ZM": "Zambia", "EH": "Western Sahara", "EE": "Estonia", "EG": "Egypt", "ZA": "South Africa", "EC": "Ecuador", "IT": "Italy", "VN": "Vietnam", "SB": "Solomon Islands", "ET": "Ethiopia", "SO": "Somalia", "ZW": "Zimbabwe", "SA": "Saudi Arabia", "ES": "Spain", "ER": "Eritrea", "ME": "Montenegro", "MD": "Moldova", "MG": "Madagascar", "MF": "Saint Martin", "MA": "Morocco", "MC": "Monaco", "UZ": "Uzbekistan", "MM": "Myanmar", "ML": "Mali", "MO": "Macao", "MN": "Mongolia", "MH": "Marshall Islands", "MK": "Macedonia", "MU": "Mauritius", "MT": "Malta", "MW": "Malawi", "MV": "Maldives", "MQ": "Martinique", "MP": "Northern Mariana Islands", "MS": "Montserrat", "MR": "Mauritania", "IM": "Isle of Man", "UG": "Uganda", "TZ": "Tanzania", "MY": "Malaysia", "MX": "Mexico", "IL": "Israel", "FR": "France", "IO": "British Indian Ocean Territory", "SH": "Saint Helena", "FI": "Finland", "FJ": "Fiji", "FK": "Falkland Islands", "FM": "Micronesia", "FO": "Faroe Islands", "NI": "Nicaragua", "NL": "Netherlands", "NO": "Norway", "NA": "Namibia", "VU": "Vanuatu", "NC": "New Caledonia", "NE": "Niger", "NF": "Norfolk Island", "NG": "Nigeria", "NZ": "New Zealand", "NP": "Nepal", "NR": "Nauru", "NU": "Niue", "CK": "Cook Islands", "XK": "Kosovo", "CI": "Ivory Coast", "CH": "Switzerland", "CO": "Colombia", "CN": "China", "CM": "Cameroon", "CL": "Chile", "CC": "Cocos Islands", "CA": "Canada", "CG": "Republic of the Congo", "CF": "Central African Republic", "CD": "Democratic Republic of the Congo", "CZ": "Czech Republic", "CY": "Cyprus", "CX": "Christmas Island", "CR": "Costa Rica", "CW": "Curacao", "CV": "Cape Verde", "CU": "Cuba", "SZ": "Swaziland", "SY": "Syria", "SX": "Sint Maarten", "KG": "Kyrgyzstan", "KE": "Kenya", "SS": "South Sudan", "SR": "Suriname", "KI": "Kiribati", "KH": "Cambodia", "KN": "Saint Kitts and Nevis", "KM": "Comoros", "ST": "Sao Tome and Principe", "SK": "Slovakia", "KR": "South Korea", "SI": "Slovenia", "KP": "North Korea", "KW": "Kuwait", "SN": "Senegal", "SM": "San Marino", "SL": "Sierra Leone", "SC": "Seychelles", "KZ": "Kazakhstan", "KY": "Cayman Islands", "SG": "Singapore", "SE": "Sweden", "SD": "Sudan", "DO": "Dominican Republic", "DM": "Dominica", "DJ": "Djibouti", "DK": "Denmark", "VG": "British Virgin Islands", "DE": "Germany", "YE": "Yemen", "DZ": "Algeria", "US": "United States", "UY": "Uruguay", "YT": "Mayotte", "UM": "United States Minor Outlying Islands", "LB": "Lebanon", "LC": "Saint Lucia", "LA": "Laos", "TV": "Tuvalu", "TW": "Taiwan", "TT": "Trinidad and Tobago", "TR": "Turkey", "LK": "Sri Lanka", "LI": "Liechtenstein", "LV": "Latvia", "TO": "Tonga", "LT": "Lithuania", "LU": "Luxembourg", "LR": "Liberia", "LS": "Lesotho", "TH": "Thailand", "TF": "French Southern Territories", "TG": "Togo", "TD": "Chad", "TC": "Turks and Caicos Islands", "LY": "Libya", "VA": "Vatican", "VC": "Saint Vincent and the Grenadines", "AE": "United Arab Emirates", "AD": "Andorra", "AG": "Antigua and Barbuda", "AF": "Afghanistan", "AI": "Anguilla", "VI": "U.S. Virgin Islands", "IS": "Iceland", "IR": "Iran", "AM": "Armenia", "AL": "Albania", "AO": "Angola", "AQ": "Antarctica", "AS": "American Samoa", "AR": "Argentina", "AU": "Australia", "AT": "Austria", "AW": "Aruba", "IN": "India", "AX": "Aland Islands", "AZ": "Azerbaijan", "IE": "Ireland", "ID": "Indonesia", "UA": "Ukraine", "QA": "Qatar", "MZ": "Mozambique"}
|