whos 0.1.6 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -35,24 +35,26 @@ Written in a fit of pique by Alex Chaffee <http://alexch.github.com>
35
35
  # Possible Improvements
36
36
 
37
37
  * shared spam db _a la_ [cheat](http://cheat.errtheblog.com)
38
+ * specify TLDs (com net org biz info us)
38
39
 
39
40
  # Release History
40
41
 
41
42
  == 0.1.2 2011/08/07
42
-
43
- First real release
43
+ * First real release
44
44
 
45
45
  == 0.1.3 2011/08/24
46
-
47
- Added verisign spam
46
+ * Added verisign spam
48
47
 
49
48
  == 0.1.4 2011/09/01
50
-
51
- Fixed "host" bug in --open option` `
52
- More spam
49
+ * Fixed "host" bug in --open option` `
50
+ * More spam
53
51
 
54
52
  == 0.1.6 2011/09/02
55
-
56
- Fixed whitespace matching bug (catches way more spam now)
57
- Oops! spam db was not included by gemspec!
58
-
53
+ * Fixed whitespace matching bug (catches way more spam now)
54
+ * Oops! spam db was not included by gemspec!
55
+
56
+ == 0.2.0 2011/09/06
57
+ * More TLDs (com net org biz info us)
58
+ * Parallel lookup (much faster)
59
+ * More spam
60
+ * Cleaner verbose output
data/lib/whos/check.rb CHANGED
@@ -1,42 +1,61 @@
1
+ require 'peach'
2
+
1
3
  module Whos
2
4
  class Check
5
+ attr_reader :responses
6
+
3
7
  def initialize
4
8
  @spam = Whos::Spam.new
9
+ @responses = {}
5
10
  end
6
-
11
+
7
12
  def available? domain
8
- print "Checking #{domain}..."
9
13
  response = `whois #{domain}`
10
14
 
11
- if response =~ /^No match for/
12
- puts " AVAILABLE!"
15
+ if response =~ /^(No match for|Not found)/i
13
16
  true
14
17
  else
15
- puts " exists :-("
16
- if $verbose
17
- puts @spam.filter(response)
18
- end
18
+ responses[domain] = @spam.filter(response)
19
19
  false
20
20
  end
21
21
  end
22
+
23
+ def tlds
24
+ %w{com net org biz info us}
25
+ end
22
26
 
23
27
  def many names
24
28
  domains = names.map do |domain|
25
29
  if domain =~ /\./
30
+ print "Checking... "
26
31
  domain
27
32
  else
28
- %w{com net org biz}.map do |tld|
33
+ puts "Checking #{domain}.#{tlds.join(',')}..."
34
+ tlds.map do |tld|
29
35
  "#{domain}.#{tld}"
30
36
  end
31
37
  end
32
38
  end.flatten
33
-
34
- domains.each do |domain|
35
- available = available? domain
36
- `open http://#{domain}` if !available and $open
39
+
40
+ domains.peach do |domain|
41
+ if available? domain
42
+ print "#{domain} AVAILABLE!\n"
43
+ else
44
+ print "#{domain} taken :-(\n"
45
+ `open http://#{domain}` if $open
46
+ end
47
+ end
48
+
49
+ if $verbose
50
+ domains.each do |domain|
51
+ if responses[domain]
52
+ puts
53
+ puts "== #{domain} =="
54
+ puts responses[domain]
55
+ end
56
+ end
37
57
  end
38
58
  end
39
59
  end
40
60
  end
41
61
 
42
-
data/spam/afilias.txt ADDED
@@ -0,0 +1,16 @@
1
+ Access to INFO WHOIS information is provided to assist persons in
2
+ determining the contents of a domain name registration record in the
3
+ Afilias registry database. The data in this record is provided by
4
+ Afilias Limited for informational purposes only, and Afilias does not
5
+ guarantee its accuracy. This service is intended only for query-based
6
+ access. You agree that you will use this data only for lawful purposes
7
+ and that, under no circumstances will you use this data to: (a) allow,
8
+ enable, or otherwise support the transmission by e-mail, telephone, or
9
+ facsimile of mass unsolicited, commercial advertising or solicitations
10
+ to entities other than the data recipient's own existing customers; or
11
+ (b) enable high volume, automated, electronic processes that send
12
+ queries or data to the systems of Registry Operator, a Registrar, or
13
+ Afilias except as reasonably necessary to register domain names or
14
+ modify existing registrations. All rights reserved. Afilias reserves
15
+ the right to modify these terms at any time. By submitting this query,
16
+ you agree to abide by this policy.
@@ -0,0 +1,115 @@
1
+ Name Server:
2
+ Status:
3
+ Registrant:
4
+ Registrant ID:
5
+ Registrant Name:
6
+ Registrant Street1:
7
+ Registrant Street2:
8
+ Registrant Street3:
9
+ Registrant City:
10
+ Registrant State/Province:
11
+ Registrant Postal Code:
12
+ Registrant Country:
13
+ Registrant Phone:
14
+ Registrant Phone Ext.:
15
+ Registrant FAX:
16
+ Registrant FAX Ext.:
17
+ Registrant Email:
18
+ Admin ID:
19
+ Admin Name:
20
+ Admin Street1:
21
+ Admin Street2:
22
+ Admin Street3:
23
+ Admin City:
24
+ Admin State/Province:
25
+ Admin Postal Code:
26
+ Admin Country:
27
+ Admin Phone:
28
+ Admin Phone Ext.:
29
+ Admin FAX:
30
+ Admin FAX Ext.:
31
+ Admin Email:
32
+ Tech ID:
33
+ Tech Name:
34
+ Tech Street1:
35
+ Tech Street2:
36
+ Tech Street3:
37
+ Tech City:
38
+ Tech State/Province:
39
+ Tech Postal Code:
40
+ Tech Country:
41
+ Tech Phone:
42
+ Tech Phone Ext.:
43
+ Tech FAX:
44
+ Tech FAX Ext.:
45
+ Tech Email:
46
+ Name Server:
47
+ DNSSEC:
48
+ Domain ID:
49
+ Domain Name:
50
+ Created On:
51
+ Last Updated On:
52
+ Expiration Date:
53
+ Sponsoring Registrar:
54
+ Status:
55
+ Registrant ID:
56
+ Registrant Name:
57
+ Registrant Organization:
58
+ Registrant Street1:
59
+ Registrant Street2:
60
+ Registrant Street3:
61
+ Registrant City:
62
+ Registrant State/Province:
63
+ Registrant Postal Code:
64
+ Registrant Country:
65
+ Registrant Phone:
66
+ Registrant Phone Ext.:
67
+ Registrant FAX:
68
+ Registrant FAX Ext.:
69
+ Registrant Email:
70
+ Admin ID:
71
+ Admin Name:
72
+ Admin Organization:
73
+ Admin Street1:
74
+ Admin Street2:
75
+ Admin Street3:
76
+ Admin City:
77
+ Admin State/Province:
78
+ Admin Postal Code:
79
+ Admin Country:
80
+ Admin Phone:
81
+ Admin Phone Ext.:
82
+ Admin FAX:
83
+ Admin FAX Ext.:
84
+ Admin Email:
85
+ Billing ID:
86
+ Billing Name:
87
+ Billing Organization:
88
+ Billing Street1:
89
+ Billing Street2:
90
+ Billing Street3:
91
+ Billing City:
92
+ Billing State/Province:
93
+ Billing Postal Code:
94
+ Billing Country:
95
+ Billing Phone:
96
+ Billing Phone Ext.:
97
+ Billing FAX:
98
+ Billing FAX Ext.:
99
+ Billing Email:
100
+ Tech ID:
101
+ Tech Name:
102
+ Tech Organization:
103
+ Tech Street1:
104
+ Tech Street2:
105
+ Tech Street3:
106
+ Tech City:
107
+ Tech State/Province:
108
+ Tech Postal Code:
109
+ Tech Country:
110
+ Tech Phone:
111
+ Tech Phone Ext.:
112
+ Tech FAX:
113
+ Tech FAX Ext.:
114
+ Tech Email:
115
+ Name Server:
@@ -0,0 +1,28 @@
1
+ ------------------------------------------------------------------------
2
+ Promote your business to millions of viewers for only $1 a month
3
+ Learn how you can get an Enhanced Business Listing here for your domain name.
4
+ Learn more at http://www.NetworkSolutions.com/
5
+ ------------------------------------------------------------------------
6
+ NOTICE AND TERMS OF USE: You are not authorized to access or query our WHOIS
7
+ database through the use of high-volume, automated, electronic processes. The
8
+ Data in Network Solutions' WHOIS database is provided by Network Solutions for information
9
+ purposes only, and to assist persons in obtaining information about or related
10
+ to a domain name registration record. Network Solutions does not guarantee its accuracy.
11
+ By submitting a WHOIS query, you agree to abide by the following terms of use:
12
+ You agree that you may use this Data only for lawful purposes and that under no
13
+ circumstances will you use this Data to: (1) allow, enable, or otherwise support
14
+ the transmission of mass unsolicited, commercial advertising or solicitations
15
+ via e-mail, telephone, or facsimile; or (2) enable high volume, automated,
16
+ electronic processes that apply to Network Solutions (or its computer systems). The
17
+ compilation, repackaging, dissemination or other use of this Data is expressly
18
+ prohibited without the prior written consent of Network Solutions. You agree not to use
19
+ high-volume, automated, electronic processes to access or query the WHOIS
20
+ database. Network Solutions reserves the right to terminate your access to the WHOIS
21
+ querying of the WHOIS database or for failure to otherwise abide by this policy.
22
+ Network Solutions reserves the right to modify these terms at any time.
23
+ Get a FREE domain name registration, transfer, or renewal with any annual hosting package.
24
+ http://www.networksolutions.com
25
+ This listing is a Network Solutions Private Registration. Mail
26
+ correspondence to this address must be sent via USPS Express Mail(TM) or
27
+ USPS Certified Mail(R); all other mail will not be processed. Be sure to
28
+ include the registrant's domain name in the address.
data/spam/neustar.txt CHANGED
@@ -18,3 +18,24 @@ subsequent notification of any kind. By executing this query, in any manner
18
18
  whatsoever, you agree to abide by these terms.
19
19
  NOTE: FAILURE TO LOCATE A RECORD IN THE WHOIS DATABASE IS NOT INDICATIVE
20
20
  OF THE AVAILABILITY OF A DOMAIN NAME.
21
+
22
+ NeuStar, Inc., the Registry Administrator for .US, has collected this
23
+ information for the WHOIS database through a .US-Accredited Registrar.
24
+ This information is provided to you for informational purposes only and is
25
+ designed to assist persons in determining contents of a domain name
26
+ registration record in the NeuStar registry database. NeuStar makes this
27
+ information available to you "as is" and does not guarantee its accuracy.
28
+ lawful purposes and that, under no circumstances will you use this data:
29
+ (1) to allow, enable, or otherwise support the transmission of mass
30
+ unsolicited, commercial advertising or solicitations via direct mail,
31
+ electronic mail, or by telephone; (2) in contravention of any applicable
32
+ data and privacy protection laws; or (3) to enable high volume, automated,
33
+ electronic processes that apply to the registry (or its systems). Compilation,
34
+ repackaging, dissemination, or other use of the WHOIS database in its
35
+ entirety, or of a substantial portion thereof, is not allowed without
36
+ NeuStar's prior written permission. NeuStar reserves the right to modify or
37
+ change these conditions at any time without prior or subsequent notification
38
+ of any kind. By executing this query, in any manner whatsoever, you agree to
39
+ abide by these terms.
40
+ All domain names are subject to certain additional domain name registration
41
+ rules. For details, please visit our site at www.whois.us.
data/whos.gemspec CHANGED
@@ -3,7 +3,7 @@ $spec = Gem::Specification.new do |s|
3
3
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
4
4
 
5
5
  s.name = 'whos'
6
- s.version = '0.1.6'
6
+ s.version = '0.2.0'
7
7
 
8
8
  s.description = "Wraps whois and removes the BS"
9
9
  s.summary = "Wraps whois and removes the registrar legal/marketing spam from the response."
@@ -23,8 +23,7 @@ $spec = Gem::Specification.new do |s|
23
23
  s.test_files = s.files.select {|path| path =~ /^spec\/.*_spec.rb/}
24
24
 
25
25
  s.extra_rdoc_files = %w[README.md]
26
- #s.add_dependency 'rack', '>= 0.9.1'
27
- #s.add_dependency 'launchy', '>= 0.3.3', '< 1.0'
26
+ s.add_dependency 'peach'
28
27
 
29
28
  s.homepage = "http://github.com/alexch/whos/"
30
29
  s.require_paths = %w[lib]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: whos
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,8 +9,19 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-09-02 00:00:00.000000000Z
13
- dependencies: []
12
+ date: 2011-09-07 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: peach
16
+ requirement: &70262591857960 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *70262591857960
14
25
  description: Wraps whois and removes the BS
15
26
  email: alex@stinky.com
16
27
  executables:
@@ -28,10 +39,13 @@ files:
28
39
  - lib/whos/spam.rb
29
40
  - lib/whos.rb
30
41
  - spam/1-and-1.txt
42
+ - spam/afilias.txt
43
+ - spam/blank-lines.txt
31
44
  - spam/dotorg.txt
32
45
  - spam/godaddy.txt
33
46
  - spam/kica.txt
34
47
  - spam/markmonitor.txt
48
+ - spam/networksolutions.txt
35
49
  - spam/neustar.txt
36
50
  - spam/tucows.txt
37
51
  - spam/verisign.txt
@@ -49,7 +63,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
49
63
  version: '0'
50
64
  segments:
51
65
  - 0
52
- hash: -3958566612259443149
66
+ hash: 724115214358494016
53
67
  required_rubygems_version: !ruby/object:Gem::Requirement
54
68
  none: false
55
69
  requirements: