ip2location_io_ruby 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0b6cc3db17af0def0fd75c9bf704ef6f9570e1dcac6283c40c9237b48f0a41fe
4
- data.tar.gz: 4dbd3e55362da1e7c4f6b1ff680504dcd552153b2eae2ceb4f0440463f27cb6a
3
+ metadata.gz: 0134dfeca234b7eee5dcd5c57aae3562e0483ec6cc99c99256498438adc8fec9
4
+ data.tar.gz: e1d8343d1f1145d76f943ae04d392825a51e2cbbe44bd3e1beaa55f3ff21317e
5
5
  SHA512:
6
- metadata.gz: b7043339f314edb74ff7cad060a9e54d1f9358abf05ecb5130cad0e51fba2f63e9b879159f261314c6960a20f69aadad11c9409d88e824aa081152c51c6d6d28
7
- data.tar.gz: b8066a4655d818a3b70b5bc521939ef195dc1ee707ec5007d5485141938471b72daf0b63a96d579cbfe7d54469fc63503d2513338620737ed3afd0762888b2db
6
+ metadata.gz: 309a5fb0988094a0d98ce1d5a495f9ffdfbe901583c3fbe148b332d3be36905a44018877cc989038368f2cca0692934fdfb7a45339c86370accac93dae8cf808
7
+ data.tar.gz: 96957a9c2689e01156a6d24072c7c66d9f425c8f7f9189a8ded3974668cce6ee5a77cd6cc19ad4f575e686e3625762ac8fe58c55e13a6344e9c2b7005f8ab433
data/Gemfile CHANGED
@@ -4,3 +4,4 @@ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
4
 
5
5
  # Specify your gem's dependencies in ip2location_io_ruby.gemspec
6
6
  gemspec
7
+ gem "simpleidn", "~> 0.2"
data/LICENSE.txt CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2023 IP2Location.com
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2023 - 2024 IP2Location.com
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md CHANGED
@@ -1,367 +1,17 @@
1
- IP2Location.io Ruby SDK
2
- ========================
3
- This Ruby module enables user to query for an enriched data set, such as country, region, district, city, latitude & longitude, ZIP code, time zone, ASN, ISP, domain, net speed, IDD code, area code, weather station data, MNC, MCC, mobile brand, elevation, usage type, address type, advertisement category and proxy data with an IP address. It supports both IPv4 and IPv6 address lookup.
4
-
5
- In addition, this module provides WHOIS lookup api that helps users to obtain domain information, WHOIS record, by using a domain name. The WHOIS API returns a comprehensive WHOIS data such as creation date, updated date, expiration date, domain age, the contact information of the registrant, mailing address, phone number, email address, nameservers the domain is using and much more.
6
-
7
- This module requires API key to function. You may sign up for a free API key at https://www.ip2location.io/pricing.
8
-
9
-
10
- Usage Example
11
- ============
12
- ### Lookup IP Address Geolocation Data
13
- ```ruby
14
- require 'ip2location_io_ruby'
15
-
16
- # Configures IP2Location.io API key
17
- IP2LocationIORuby::Configuration.api_key = 'YOUR_API_KEY'
18
-
19
- # Lookup ip address geolocation data
20
- IP2LocationIORuby::Api::IPGeolocation.lookup('8.8.8.8', 'en'); # The language parameter is only available for Plus and Security plan only.
21
- ```
22
-
23
- ### Lookup Domain Information
24
- ```ruby
25
- require 'ip2location_io_ruby'
26
-
27
- # Configures IP2Location.io API key
28
- IP2LocationIORuby::Configuration.api_key = 'YOUR_API_KEY'
29
-
30
- # Lookup domain information
31
- IP2LocationIORuby::Api::DomainWhois.lookup('example.com');
32
- ```
33
-
34
- ### Convert Normal Text to Punycode
35
- ```ruby
36
- require 'ip2location_io_ruby'
37
-
38
- # Configures IP2Location.io API key
39
- IP2LocationIORuby::Configuration.api_key = 'YOUR_API_KEY'
40
-
41
- # Convert normal text to punycode
42
- IP2LocationIORuby::Api::DomainWhois.get_punycode('täst.de');
43
- ```
44
-
45
- ### Convert Punycode to Normal Text
46
- ```ruby
47
- require 'ip2location_io_ruby'
48
-
49
- # Configures IP2Location.io API key
50
- IP2LocationIORuby::Configuration.api_key = 'YOUR_API_KEY'
51
-
52
- # Convert punycode to normal text
53
- IP2LocationIORuby::Api::DomainWhois.get_normal_text('xn--tst-qla.de');
54
- ```
55
-
56
- ### Get Domain Name
57
- ```ruby
58
- require 'ip2location_io_ruby'
59
-
60
- # Configures IP2Location.io API key
61
- IP2LocationIORuby::Configuration.api_key = 'YOUR_API_KEY'
62
-
63
- # Get domain name from URL
64
- IP2LocationIORuby::Api::DomainWhois.get_domain_name('https://www.example.com/exe');
65
- ```
66
-
67
- ### Get Domain Extension
68
- ```ruby
69
- require 'ip2location_io_ruby'
70
-
71
- # Configures IP2Location.io API key
72
- IP2LocationIORuby::Configuration.api_key = 'YOUR_API_KEY'
73
-
74
- # Get domain extension (gTLD or ccTLD) from URL or domain name
75
- IP2LocationIORuby::Api::DomainWhois.get_domain_extension('example.com');
76
- ```
77
-
78
-
79
- Response Parameter
80
- ============
81
- ### IP Geolocation Lookup function
82
- | Parameter | Type | Description |
83
- |---|---|---|
84
- |ip|string|IP address.|
85
- |country_code|string|Two-character country code based on ISO 3166.|
86
- |country_name|string|Country name based on ISO 3166.|
87
- |region_name|string|Region or state name.|
88
- |city_name|string|City name.|
89
- |latitude|double|City latitude. Defaults to capital city latitude if city is unknown.|
90
- |longitude|double|City longitude. Defaults to capital city longitude if city is unknown.|
91
- |zip_code|string|ZIP/Postal code.|
92
- |time_zone|string|UTC time zone (with DST supported).|
93
- |asn|string|Autonomous system number (ASN).|
94
- |as|string|Autonomous system (AS) name.|
95
- |isp|string|Internet Service Provider or company's name.|
96
- |domain|string|Internet domain name associated with IP address range.|
97
- |net_speed|string|Internet connection type. DIAL = dial-up, DSL = broadband/cable/fiber/mobile, COMP = company/T1|
98
- |idd_code|string|The IDD prefix to call the city from another country.|
99
- |area_code|string|A varying length number assigned to geographic areas for calls between cities.|
100
- |weather_station_code|string|The special code to identify the nearest weather observation station.|
101
- |weather_station_name|string|The name of the nearest weather observation station.|
102
- |mcc|string|Mobile Country Codes (MCC) as defined in ITU E.212 for use in identifying mobile stations in wireless telephone networks, particularly GSM and UMTS networks.|
103
- |mnc|string|Mobile Network Code (MNC) is used in combination with a Mobile Country Code (MCC) to uniquely identify a mobile phone operator or carrier.|
104
- |mobile_brand|string|Commercial brand associated with the mobile carrier.|
105
- |elevation|integer|Average height of city above sea level in meters (m).|
106
- |usage_type|string|Usage type classification of ISP or company.|
107
- |address_type|string|IP address types as defined in Internet Protocol version 4 (IPv4) and Internet Protocol version 6 (IPv6).|
108
- |continent.name|string|Continent name.|
109
- |continent.code|string|Two-character continent code.|
110
- |continent.hemisphere|array|The hemisphere of where the country located. The data in array format with first item indicates (north/south) hemisphere and second item indicates (east/west) hemisphere information.|
111
- |continent.translation|object|Translation data based on the given lang code.|
112
- |country.name|string|Country name based on ISO 3166.|
113
- |country.alpha3_code|string|Three-character country code based on ISO 3166.|
114
- |country.numeric_code|string|Three-character country numeric code based on ISO 3166.|
115
- |country.demonym|string|Native of the country.|
116
- |country.flag|string|URL of the country flag image.|
117
- |country.capital|string|Capital of the country.|
118
- |country.total_area|integer|Total area in km2.|
119
- |country.population|integer|Population of the country.|
120
- |country.currency|object|Currency of the country.|
121
- |country.language|object|Language of the country.|
122
- |country.tld|string|Country-Code Top-Level Domain.|
123
- |country.translation|object|Translation data based on the given lang code.|
124
- |region.name|string|Region or state name.|
125
- |region.code|string|ISO3166-2 code.|
126
- |region.translation|object|Translation data based on the given lang code.|
127
- |city.name|string| City name.|
128
- |city.translation|object|Translation data based on the given lang code.|
129
- |time_zone_info.olson|string|Time zone in Olson format.|
130
- |time_zone_info.current_time|string|Current time in ISO 8601 format.|
131
- |time_zone_info.gmt_offset|integer|GMT offset value in seconds.|
132
- |time_zone_info.is_dst|boolean|Indicate if the time zone value is in DST.|
133
- |time_zone_info.sunrise|string|Time of sunrise. (hh:mm format in local time, i.e, 07:47)|
134
- |time_zone_info.sunset|string|Time of sunset. (hh:mm format in local time, i.e 19:50)|
135
- |geotargeting.metro|string|Metro code based on zip/postal code.|
136
- |ads_category|string|The domain category code based on IAB Tech Lab Content Taxonomy.|
137
- |ads_category_name|string|The domain category based on IAB Tech Lab Content Taxonomy. These categories are comprised of Tier-1 and Tier-2 (if available) level categories widely used in services like advertising, Internet security and filtering appliances.|
138
- |is_proxy|boolean|Whether is a proxy or not.|
139
- |proxy.last_seen|integer|Proxy last seen in days.|
140
- |proxy.proxy_type|string|Type of proxy.|
141
- |proxy.threat|string|Security threat reported.|
142
- |proxy.provider|string|Name of VPN provider if available.|
143
-
144
- ```json
145
- {
146
- "ip":"8.8.8.8",
147
- "country_code":"US",
148
- "country_name":"United States of America",
149
- "region_name":"California",
150
- "city_name":"Mountain View",
151
- "latitude":37.405992,
152
- "longitude":-122.078515,
153
- "zip_code":"94043",
154
- "time_zone":"-07:00",
155
- "asn":"15169",
156
- "as":"Google LLC",
157
- "isp":"Google LLC",
158
- "domain":"google.com",
159
- "net_speed":"T1",
160
- "idd_code":"1",
161
- "area_code":"650",
162
- "weather_station_code":"USCA0746",
163
- "weather_station_name":"Mountain View",
164
- "mcc":"-",
165
- "mnc":"-",
166
- "mobile_brand":"-",
167
- "elevation":32,
168
- "usage_type":"DCH",
169
- "address_type":"Anycast",
170
- "continent":{
171
- "name":"North America",
172
- "code":"NA",
173
- "hemisphere":["north","west"],
174
- "translation":{
175
- "lang":"ko",
176
- "value":"북아메리카"
177
- }
178
- },
179
- "country":{
180
- "name":"United States of America",
181
- "alpha3_code":"USA",
182
- "numeric_code":840,
183
- "demonym":"Americans",
184
- "flag":"https://cdn.ip2location.io/assets/img/flags/us.png",
185
- "capital":"Washington, D.C.",
186
- "total_area":9826675,
187
- "population":331002651,
188
- "currency":{
189
- "code":"USD",
190
- "name":"United States Dollar",
191
- "symbol":"$"
192
- },
193
- "language":{
194
- "code":"EN",
195
- "name":"English"
196
- },
197
- "tld":"us",
198
- "translation":{
199
- "lang":"ko",
200
- "value":"미국"
201
- }
202
- },
203
- "region":{
204
- "name":"California",
205
- "code":"US-CA",
206
- "translation":{
207
- "lang":"ko",
208
- "value":"캘리포니아주"
209
- }
210
- },
211
- "city":{
212
- "name":"Mountain View",
213
- "translation":{
214
- "lang":null,
215
- "value":null
216
- }
217
- },
218
- "time_zone_info":{
219
- "olson":"America/Los_Angeles",
220
- "current_time":"2022-04-18T23:41:57-07:00",
221
- "gmt_offset":-25200,
222
- "is_dst":true,
223
- "sunrise":"06:27",
224
- "sunset":"19:47"
225
- },
226
- "geotargeting":{
227
- "metro":"807"
228
- },
229
- "ads_category":"IAB19",
230
- "ads_category_name":"Technology & Computing",
231
- "is_proxy":false,
232
- "proxy":{
233
- "last_seen":18,
234
- "proxy_type":"DCH",
235
- "threat":"-",
236
- "provider":"-"
237
- }
238
- }
239
- ```
240
-
241
- ### Domain WHOIS Lookup function
242
- | Parameter | Type | Description |
243
- |---|---|---|
244
- |domain|string|Domain name.|
245
- |domain_id|string|Domain name ID.|
246
- |status|string|Domain name status.|
247
- |create_date|string|Domain name creation date.|
248
- |update_date|string|Domain name updated date.|
249
- |expire_date|string|Domain name expiration date.|
250
- |domain_age|integer|Domain name age in day(s).|
251
- |whois_server|string|WHOIS server name.|
252
- |registrar.iana_id|string|Registrar IANA ID.|
253
- |registrar.name|string|Registrar name.|
254
- |registrar.url|string|Registrar URL.|
255
- |registrant.name|string|Registrant name.|
256
- |registrant.organization|string|Registrant organization.|
257
- |registrant.street_address|string|Registrant street address.|
258
- |registrant.city|string|Registrant city.|
259
- |registrant.region|string|Registrant region.|
260
- |registrant.zip_code|string|Registrant ZIP Code.|
261
- |registrant.country|string|Registrant country.|
262
- |registrant.phone|string|Registrant phone number.|
263
- |registrant.fax|string|Registrant fax number.|
264
- |registrant.email|string|Registrant email address.|
265
- |admin.name|string|Admin name.|
266
- |admin.organization|string|Admin organization.|
267
- |admin.street_address|string|Admin street address.|
268
- |admin.city|string|Admin city.|
269
- |admin.region|string|Admin region.|
270
- |admin.zip_code|string|Admin ZIP Code.|
271
- |admin.country|string|Admin country.|
272
- |admin.phone|string|Admin phone number.|
273
- |admin.fax|string|Admin fax number.|
274
- |admin.email|string|Admin email address.|
275
- |tech.name|string|Tech name.|
276
- |tech.organization|string|Tech organization.|
277
- |tech.street_address|string|Tech street address.|
278
- |tech.city|string|Tech city.|
279
- |tech.region|string|Tech region.|
280
- |tech.zip_code|string|Tech ZIP Code.|
281
- |tech.country|string|Tech country.|
282
- |tech.phone|string|Tech phone number.|
283
- |tech.fax|string|Tech fax number.|
284
- |tech.email|string|Tech email address.|
285
- |billing.name|string|Billing name.|
286
- |billing.organization|string|Billing organization.|
287
- |billing.street_address|string|Billing street address.|
288
- |billing.city|string|Billing city.|
289
- |billing.region|string|Billing region.|
290
- |billing.zip_code|string|Billing ZIP Code.|
291
- |billing.country|string|Billing country.|
292
- |billing.phone|string|Billing phone number.|
293
- |billing.fax|string|Billing fax number.|
294
- |billing.email|string|Billing email address.|
295
- |name_servers|array|Name servers|
296
-
297
- ```json
298
- {
299
- "domain": "locaproxy.com",
300
- "domain_id": "1710914405_DOMAIN_COM-VRSN",
301
- "status": "clientTransferProhibited https://icann.org/epp#clientTransferProhibited",
302
- "create_date": "2012-04-03T02:34:32Z",
303
- "update_date": "2021-12-03T02:54:57Z",
304
- "expire_date": "2024-04-03T02:34:32Z",
305
- "domain_age": 3863,
306
- "whois_server": "whois.godaddy.com",
307
- "registrar": {
308
- "iana_id": "146",
309
- "name": "GoDaddy.com, LLC",
310
- "url": "https://www.godaddy.com"
311
- },
312
- "registrant": {
313
- "name": "Registration Private",
314
- "organization": "Domains By Proxy, LLC",
315
- "street_address": "DomainsByProxy.com",
316
- "city": "Tempe",
317
- "region": "Arizona",
318
- "zip_code": "85284",
319
- "country": "US",
320
- "phone": "+1.4806242599",
321
- "fax": "+1.4806242598",
322
- "email": "Select Contact Domain Holder link at https://www.godaddy.com/whois/results.aspx?domain=LOCAPROXY.COM"
323
- },
324
- "admin": {
325
- "name": "Registration Private",
326
- "organization": "Domains By Proxy, LLC",
327
- "street_address": "DomainsByProxy.com",
328
- "city": "Tempe",
329
- "region": "Arizona",
330
- "zip_code": "85284",
331
- "country": "US",
332
- "phone": "+1.4806242599",
333
- "fax": "+1.4806242598",
334
- "email": "Select Contact Domain Holder link at https://www.godaddy.com/whois/results.aspx?domain=LOCAPROXY.COM"
335
- },
336
- "tech": {
337
- "name": "Registration Private",
338
- "organization": "Domains By Proxy, LLC",
339
- "street_address": "DomainsByProxy.com",
340
- "city": "Tempe",
341
- "region": "Arizona",
342
- "zip_code": "85284",
343
- "country": "US",
344
- "phone": "+1.4806242599",
345
- "fax": "+1.4806242598",
346
- "email": "Select Contact Domain Holder link at https://www.godaddy.com/whois/results.aspx?domain=LOCAPROXY.COM"
347
- },
348
- "billing": {
349
- "name": "",
350
- "organization": "",
351
- "street_address": "",
352
- "city": "",
353
- "region": "",
354
- "zip_code": "",
355
- "country": "",
356
- "phone": "",
357
- "fax": "",
358
- "email": ""
359
- },
360
- "nameservers": "vera.ns.cloudflare.com, walt.ns.cloudflare.com"
361
- }
362
- ```
363
-
364
-
365
- LICENCE
366
- =====================
367
- See the LICENSE file.
1
+ IP2Location.io Ruby SDK
2
+ ========================
3
+ This Ruby module enables user to query for an enriched data set, such as country, region, district, city, latitude & longitude, ZIP code, time zone, ASN, ISP, domain, net speed, IDD code, area code, weather station data, MNC, MCC, mobile brand, elevation, usage type, address type, advertisement category and proxy data with an IP address. It supports both IPv4 and IPv6 address lookup.
4
+
5
+ In addition, this module provides WHOIS lookup api that helps users to obtain domain information, WHOIS record, by using a domain name. The WHOIS API returns a comprehensive WHOIS data such as creation date, updated date, expiration date, domain age, the contact information of the registrant, mailing address, phone number, email address, nameservers the domain is using and much more.
6
+
7
+ This module requires API key to function. You may sign up for a free API key at https://www.ip2location.io/pricing.
8
+
9
+ Developer Documentation
10
+ =====================
11
+
12
+ To learn more about installation, usage, and code examples, please visit the developer documentation at [https://ip2location-io-ruby.readthedocs.io/en/latest/index.html](https://ip2location-io-ruby.readthedocs.io/en/latest/index.html).
13
+
14
+
15
+ LICENCE
16
+ =====================
17
+ See the LICENSE file.
@@ -36,4 +36,5 @@ Gem::Specification.new do |s|
36
36
  "spec/ip2location_io_ruby_domainwhois_spec.rb",
37
37
  "spec/ip2location_io_ruby_ipgeolocation_spec.rb"
38
38
  ]
39
+ s.add_runtime_dependency "simpleidn", "~> 0.2"
39
40
  end
@@ -1,3 +1,3 @@
1
1
  module IP2LocationIORuby
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ip2location_io_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - IP2Location
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-18 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2024-11-21 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: simpleidn
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.2'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.2'
13
27
  description: IP2Location.IO Ruby SDK allows user to query for an enriched data set
14
28
  based on IP address and provides WHOIS lookup api that helps users to obtain domain
15
29
  information.
@@ -56,7 +70,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
56
70
  - !ruby/object:Gem::Version
57
71
  version: '0'
58
72
  requirements: []
59
- rubygems_version: 3.3.7
73
+ rubygems_version: 3.5.23
60
74
  signing_key:
61
75
  specification_version: 4
62
76
  summary: IP2Location IO Ruby SDK