sgeoip 0.0.6 → 0.0.7

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.
Files changed (2) hide show
  1. metadata +3 -4
  2. data/lib/sgeoip.rb +0 -21
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sgeoip
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -33,14 +33,13 @@ email:
33
33
  executables: []
34
34
  extensions: []
35
35
  extra_rdoc_files: []
36
- files:
37
- - ./lib/sgeoip.rb
36
+ files: []
38
37
  homepage: ''
39
38
  licenses: []
40
39
  post_install_message:
41
40
  rdoc_options: []
42
41
  require_paths:
43
- - ./lib
42
+ - lib
44
43
  required_ruby_version: !ruby/object:Gem::Requirement
45
44
  none: false
46
45
  requirements:
data/lib/sgeoip.rb DELETED
@@ -1,21 +0,0 @@
1
- require "geoip/version"
2
- require 'nokogiri'
3
- require 'open-uri'
4
-
5
- module Sgeoip
6
- def self.scrape(ip)
7
- url = "http://www.geoiptool.com/en/?#{ip}"
8
- doc = Nokogiri::HTML(open(url))
9
- geoip = { "host" => doc.at_css(".tbl_style tr:nth-child(1) td.arial_bold").text,
10
- "country" => doc.at_css(".tbl_style tr:nth-child(3) td.arial_bold").text,
11
- "country_code" => doc.at_css(".tbl_style tr:nth-child(4) td.arial_bold").text,
12
- "region" => doc.at_css(".tbl_style tr:nth-child(5) td.arial_bold").text,
13
- "city" => doc.at_css(".tbl_style tr:nth-child(6) td.arial_bold").text,
14
- "zip" => doc.at_css(".tbl_style tr:nth-child(7) td.arial_bold").text
15
- }
16
- if geoip[:host].nil?
17
- geoip[:error] = "Results Not Found"
18
- end
19
- geoip
20
- end
21
- end