simple_geolocator 1.2.0 → 1.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/CHANGELOG.md +3 -0
- data/bin/simplegeo +38 -0
- metadata +36 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec8abe6e25bd0b1224b59fe7f0f2eeab0c60be25
|
4
|
+
data.tar.gz: be578158bada87e3bffd34478bda41799ba14852
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d415d96053e1bf8536401de9a49e7aef3e1c5e00589c89a2780ceab8dee90e81562d1f43beb1a0c5cf6ff31df93d9addea43168ae871db433cfb2df64c172ab
|
7
|
+
data.tar.gz: 62ed3cc9bc79207228aa421ff774c2d95b6759d3f9946dd94d5a9787337c5a20e84a9e4389776fe428382d517c00d00c3e55cdcee2f045e212c9a2c2ecfa5b28
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# Changelog
|
2
2
|
## Version 1
|
3
|
+
### Version 1.3.0
|
4
|
+
* New CLI called 'simplegeo'. Simply pass it an IP and it'll give you data!
|
5
|
+
|
3
6
|
### Version 1.2.0
|
4
7
|
* Implement a simple cache that will prevent you ever exceeding the request quota! (vladc)
|
5
8
|
* New method connection for getting the types of connection you have (proxy and/or mobile) (vladc)
|
data/bin/simplegeo
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# encoding: utf-8
|
3
|
+
|
4
|
+
path = File.expand_path('../lib', __FILE__)
|
5
|
+
$LOAD_PATH.unshift(path)
|
6
|
+
|
7
|
+
require 'rainbow'
|
8
|
+
require 'string-utility'
|
9
|
+
require_relative '../lib/simple_geolocator'
|
10
|
+
|
11
|
+
if ARGV.empty?
|
12
|
+
puts 'You must provide an IP.'
|
13
|
+
exit
|
14
|
+
end
|
15
|
+
|
16
|
+
ip = ARGV[0]
|
17
|
+
city = SimpleGeolocator.city(ip)
|
18
|
+
region = SimpleGeolocator.region(ip)[:name]
|
19
|
+
country = SimpleGeolocator.country(ip)[:name]
|
20
|
+
zip = SimpleGeolocator.zip(ip)
|
21
|
+
ll = SimpleGeolocator.ll(ip)
|
22
|
+
timezone = SimpleGeolocator.timezone(ip)
|
23
|
+
isp = SimpleGeolocator.isp_name(ip)
|
24
|
+
org = SimpleGeolocator.organization_name(ip)
|
25
|
+
connection_attributes = SimpleGeolocator.connection(ip)
|
26
|
+
|
27
|
+
puts "Here is the data for #{ip}:"
|
28
|
+
puts Rainbow("ISP: #{isp}").color(StringUtility.random_color_six)
|
29
|
+
puts Rainbow("Organization: #{org}").color(StringUtility.random_color_six)
|
30
|
+
puts Rainbow("Timezone: #{timezone}").color(StringUtility.random_color_six)
|
31
|
+
puts Rainbow("Location: #{city}, #{region}, #{country}, #{zip}")
|
32
|
+
.color(StringUtility.random_color_six)
|
33
|
+
puts Rainbow("Exact location: #{ll[0]}, #{ll[1]}")
|
34
|
+
.color(StringUtility.random_color_six)
|
35
|
+
puts Rainbow('They are using a mobile connection.')
|
36
|
+
.color(StringUtility.random_color_six) if connection_attributes[:mobile]
|
37
|
+
puts Rainbow('They are using a proxy.')
|
38
|
+
.color(StringUtility.random_color_six) if connection_attributes[:proxy]
|
metadata
CHANGED
@@ -1,15 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_geolocator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eli Foster
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-11-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rainbow
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 2.0.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 2.0.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: string-utility
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 2.5.0
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 2.5.0
|
13
41
|
- !ruby/object:Gem::Dependency
|
14
42
|
name: httpclient
|
15
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -34,13 +62,16 @@ description: Accessing the IP API through HTTPClient. I found that many, if not
|
|
34
62
|
Geolocation gems were very annoying and overly-complex to use. Thus, this gem was
|
35
63
|
born. It does not use anything like Google or Yahoo! Geolocation because I have
|
36
64
|
found that those APIs are unpredictable and often-times broken. This Gem has been
|
37
|
-
made to be as simple to use as possible.
|
65
|
+
made to be as simple to use as possible. It also includes a CLI that can be called
|
66
|
+
simple as 'simplegeo' followed by the IP.
|
38
67
|
email: elifosterwy@gmail.com
|
39
|
-
executables:
|
68
|
+
executables:
|
69
|
+
- simplegeo
|
40
70
|
extensions: []
|
41
71
|
extra_rdoc_files: []
|
42
72
|
files:
|
43
73
|
- CHANGELOG.md
|
74
|
+
- bin/simplegeo
|
44
75
|
- lib/simple_geolocator.rb
|
45
76
|
homepage: https://github.com/elifoster/simple_geolocator
|
46
77
|
licenses:
|
@@ -68,3 +99,4 @@ signing_key:
|
|
68
99
|
specification_version: 4
|
69
100
|
summary: A Ruby gem for easily using the IP-API.com API to perform IP geolocation.
|
70
101
|
test_files: []
|
102
|
+
has_rdoc:
|