wmap 2.7.2 → 2.7.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +10 -16
- data/bin/refresh +5 -5
- data/lib/wmap.rb +1 -1
- data/lib/wmap/site_tracker.rb +1 -4
- data/lib/wmap/{wp_tracker.rb → site_tracker/wp_tracker.rb} +41 -4
- data/lib/wmap/url_crawler.rb +1 -1
- data/version.txt +2 -2
- data/wmap.gemspec +2 -2
- metadata +4 -59
- data/ruby_whois_patches/base_cocca2.rb +0 -149
- data/ruby_whois_patches/kero.yachay.pe.rb +0 -120
- data/ruby_whois_patches/whois.PublicDomainRegistry.com.rb +0 -124
- data/ruby_whois_patches/whois.above.com.rb +0 -61
- data/ruby_whois_patches/whois.adamsnames.tc.rb +0 -107
- data/ruby_whois_patches/whois.aeda.net.ae.rb +0 -105
- data/ruby_whois_patches/whois.ai.rb +0 -112
- data/ruby_whois_patches/whois.arnes.si.rb +0 -121
- data/ruby_whois_patches/whois.ascio.com.rb +0 -91
- data/ruby_whois_patches/whois.cnnic.cn.rb +0 -123
- data/ruby_whois_patches/whois.corporatedomains.com.rb +0 -67
- data/ruby_whois_patches/whois.crsnic.net.rb +0 -108
- data/ruby_whois_patches/whois.denic.de.rb +0 -174
- data/ruby_whois_patches/whois.dk-hostmaster.dk.rb +0 -120
- data/ruby_whois_patches/whois.dns.be.rb +0 -134
- data/ruby_whois_patches/whois.dns.lu.rb +0 -129
- data/ruby_whois_patches/whois.dns.pl.rb +0 -150
- data/ruby_whois_patches/whois.dns.pt.rb +0 -119
- data/ruby_whois_patches/whois.domain.kg.rb +0 -126
- data/ruby_whois_patches/whois.domainregistry.my.rb +0 -123
- data/ruby_whois_patches/whois.domreg.lt.rb +0 -110
- data/ruby_whois_patches/whois.dot.tk.rb +0 -140
- data/ruby_whois_patches/whois.hkirc.hk.rb +0 -121
- data/ruby_whois_patches/whois.isnic.is.rb +0 -130
- data/ruby_whois_patches/whois.je.rb +0 -119
- data/ruby_whois_patches/whois.jprs.jp.rb +0 -137
- data/ruby_whois_patches/whois.kenic.or.ke.rb +0 -140
- data/ruby_whois_patches/whois.markmonitor.com.rb +0 -118
- data/ruby_whois_patches/whois.melbourneit.com.rb +0 -58
- data/ruby_whois_patches/whois.nic.as.rb +0 -96
- data/ruby_whois_patches/whois.nic.at.rb +0 -109
- data/ruby_whois_patches/whois.nic.ch.rb +0 -141
- data/ruby_whois_patches/whois.nic.cl.rb +0 -117
- data/ruby_whois_patches/whois.nic.ec.rb +0 -157
- data/ruby_whois_patches/whois.nic.im.rb +0 -120
- data/ruby_whois_patches/whois.nic.it.rb +0 -170
- data/ruby_whois_patches/whois.nic.lv.rb +0 -116
- data/ruby_whois_patches/whois.nic.ly.rb +0 -127
- data/ruby_whois_patches/whois.nic.mu.rb +0 -27
- data/ruby_whois_patches/whois.nic.mx.rb +0 -123
- data/ruby_whois_patches/whois.nic.net.sa.rb +0 -111
- data/ruby_whois_patches/whois.nic.or.kr.rb +0 -101
- data/ruby_whois_patches/whois.nic.tel.rb +0 -129
- data/ruby_whois_patches/whois.nic.tr.rb +0 -133
- data/ruby_whois_patches/whois.nic.us.rb +0 -129
- data/ruby_whois_patches/whois.nic.ve.rb +0 -135
- data/ruby_whois_patches/whois.norid.no.rb +0 -127
- data/ruby_whois_patches/whois.pandi.or.id.rb +0 -118
- data/ruby_whois_patches/whois.psi-usa.info.rb +0 -63
- data/ruby_whois_patches/whois.registro.br.rb +0 -109
- data/ruby_whois_patches/whois.registrygate.com.rb +0 -55
- data/ruby_whois_patches/whois.rrpproxy.net.rb +0 -61
- data/ruby_whois_patches/whois.sgnic.sg.rb +0 -130
- data/ruby_whois_patches/whois.srs.net.nz.rb +0 -166
- data/ruby_whois_patches/whois.tucows.com.rb +0 -70
- data/ruby_whois_patches/whois.twnic.net.tw.rb +0 -133
@@ -1,111 +0,0 @@
|
|
1
|
-
#--
|
2
|
-
# Ruby Whois
|
3
|
-
#
|
4
|
-
# An intelligent pure Ruby WHOIS client and parser.
|
5
|
-
#
|
6
|
-
# Copyright (c) 2009-2012 Simone Carletti <weppos@weppos.net>
|
7
|
-
#++
|
8
|
-
|
9
|
-
|
10
|
-
require 'whois/record/parser/base'
|
11
|
-
|
12
|
-
|
13
|
-
module Whois
|
14
|
-
class Record
|
15
|
-
class Parser
|
16
|
-
|
17
|
-
#
|
18
|
-
# = whois.nic.net.sa parser
|
19
|
-
#
|
20
|
-
# Parser for the whois.nic.net.sa server.
|
21
|
-
#
|
22
|
-
# NOTE: This parser is just a stub and provides only a few basic methods
|
23
|
-
# to check for domain availability and get domain status.
|
24
|
-
# Please consider to contribute implementing missing methods.
|
25
|
-
# See WhoisNicIt parser for an explanation of all available methods
|
26
|
-
# and examples.
|
27
|
-
#
|
28
|
-
class WhoisNicNetSa < Base
|
29
|
-
|
30
|
-
property_supported :status do
|
31
|
-
if available?
|
32
|
-
:available
|
33
|
-
else
|
34
|
-
:registered
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
property_supported :available? do
|
39
|
-
!!(content_for_scanner =~ /^No match\.$/)
|
40
|
-
end
|
41
|
-
|
42
|
-
property_supported :registered? do
|
43
|
-
!available?
|
44
|
-
end
|
45
|
-
|
46
|
-
property_supported :created_on do
|
47
|
-
if content_for_scanner =~ /reg-date:\s+(.*)\n/
|
48
|
-
Time.parse($1)
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
property_not_supported :updated_on
|
53
|
-
|
54
|
-
property_not_supported :expires_on
|
55
|
-
|
56
|
-
# The following methods are implemented by Yang Li on 2/7/2013
|
57
|
-
# ----------------------------------------------------------------------------
|
58
|
-
property_supported :nameservers do
|
59
|
-
if content_for_scanner =~ /Name\sServers:\n((.+\n)+)\n/
|
60
|
-
$1.split("\n").map do |name|
|
61
|
-
Record::Nameserver.new(:name => name.strip.downcase)
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
property_supported :domain do
|
67
|
-
#return $1.strip if content_for_scanner =~ /^Domain\sName:(.*)\n/i
|
68
|
-
return $1.strip if content_for_scanner =~ /Registrant:\n((.+\n)+)\n/i
|
69
|
-
end
|
70
|
-
|
71
|
-
property_not_supported :domain_id
|
72
|
-
|
73
|
-
property_not_supported :registrar
|
74
|
-
|
75
|
-
property_supported :admin_contacts do
|
76
|
-
build_contact("Administrative Contact", Whois::Record::Contact::TYPE_ADMIN)
|
77
|
-
end
|
78
|
-
|
79
|
-
property_supported :registrant_contacts do
|
80
|
-
build_contact("Registrant", Whois::Record::Contact::TYPE_REGISTRANT)
|
81
|
-
end
|
82
|
-
|
83
|
-
property_supported :technical_contacts do
|
84
|
-
build_contact("Technical Contact", Whois::Record::Contact::TYPE_TECHNICAL)
|
85
|
-
end
|
86
|
-
|
87
|
-
property_not_supported :billing_contacts
|
88
|
-
|
89
|
-
private
|
90
|
-
|
91
|
-
def build_contact(element, type)
|
92
|
-
reg=Record::Contact.new(:type => type)
|
93
|
-
if content_for_scanner =~ /#{element}:\n((.+\n)+)\n/i
|
94
|
-
line_num=1
|
95
|
-
$1.split(%r{\n}).each do |line|
|
96
|
-
reg["name"]=line.strip if line_num==1
|
97
|
-
reg["organization"]=line.strip if line_num==1
|
98
|
-
reg["address"]=line.split(':')[1].strip if line_num==2
|
99
|
-
reg["city"]=line.strip if line_num==3
|
100
|
-
reg["country"]=line.strip if line_num==4
|
101
|
-
line_num=line_num+1
|
102
|
-
end
|
103
|
-
end
|
104
|
-
return reg
|
105
|
-
end
|
106
|
-
# ----------------------------------------------------------------------------
|
107
|
-
|
108
|
-
end
|
109
|
-
end
|
110
|
-
end
|
111
|
-
end
|
@@ -1,101 +0,0 @@
|
|
1
|
-
#--
|
2
|
-
# Ruby Whois
|
3
|
-
#
|
4
|
-
# An intelligent pure Ruby WHOIS client and parser.
|
5
|
-
#
|
6
|
-
# Copyright (c) 2009-2012 Simone Carletti <weppos@weppos.net>
|
7
|
-
#++
|
8
|
-
|
9
|
-
require 'whois/record/parser/base'
|
10
|
-
|
11
|
-
module Whois
|
12
|
-
class Record
|
13
|
-
class Parser
|
14
|
-
|
15
|
-
# Parser for the whois.nic.or.kr server, on the english section only; added by Yang Li 02/10/2013.
|
16
|
-
class WhoisNicOrKr < Base
|
17
|
-
|
18
|
-
property_supported :status do
|
19
|
-
content_for_scanner.scan(/Publishes\s+:\s*(.+)\n/).flatten
|
20
|
-
end
|
21
|
-
|
22
|
-
property_supported :available? do
|
23
|
-
!!(content_for_scanner =~ /is not registered:/)
|
24
|
-
end
|
25
|
-
|
26
|
-
property_supported :registered? do
|
27
|
-
!available?
|
28
|
-
end
|
29
|
-
|
30
|
-
property_supported :created_on do
|
31
|
-
if content_for_scanner =~ /Registered Date\s+:\s*(.+?)\n/
|
32
|
-
Time.parse($1)
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
property_supported :updated_on do
|
37
|
-
if content_for_scanner =~ /Last updated Date\s+:\s*(.+?)\n/
|
38
|
-
Time.parse($1)
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
property_supported :expires_on do
|
43
|
-
if content_for_scanner =~ /Expiration Date\s+:\s*(.+?)\n/
|
44
|
-
Time.parse($1)
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
property_supported :nameservers do
|
49
|
-
content_for_scanner.scan(/Host Name\s+:\s*(.+)\n/).flatten.map do |name|
|
50
|
-
Record::Nameserver.new(:name => name.downcase)
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
property_supported :registrar do
|
55
|
-
reg=Record::Registrar.new
|
56
|
-
content_for_scanner.scan(/^(Authorized.*):\s+(.+)\n/).map do |entry|
|
57
|
-
reg["name"] = entry[1].split('(')[0] if entry[0] =~ /Agency/i
|
58
|
-
reg["organization"] = entry[1].split('(')[0] if entry[0] =~ /Agency/i
|
59
|
-
reg["url"] = entry[1].split('(')[1].split(')')[0] if entry[0] =~ /Agency/i
|
60
|
-
end
|
61
|
-
return reg
|
62
|
-
end
|
63
|
-
|
64
|
-
property_supported :admin_contacts do
|
65
|
-
build_contact_ac("AC", Whois::Record::Contact::TYPE_ADMIN)
|
66
|
-
end
|
67
|
-
|
68
|
-
property_supported :registrant_contacts do
|
69
|
-
build_contact("Registrant", Whois::Record::Contact::TYPE_REGISTRANT)
|
70
|
-
end
|
71
|
-
|
72
|
-
property_not_supported :technical_contacts
|
73
|
-
|
74
|
-
property_not_supported :billing_contacts
|
75
|
-
|
76
|
-
private
|
77
|
-
|
78
|
-
def build_contact_ac(element, type)
|
79
|
-
reg=Record::Contact.new(:type => type)
|
80
|
-
content_for_scanner.scan(/^(.*#{element}.*):\s*(.+)\n/).map do |entry|
|
81
|
-
reg["name"]=entry[1] if entry[0] =~ /Administrative\sContact/i
|
82
|
-
reg["phone"]=entry[1] if entry[0]=~ /phone/i
|
83
|
-
reg["email"]=entry[1] if entry[0]=~ /E\-Mail/i
|
84
|
-
end
|
85
|
-
return reg
|
86
|
-
end
|
87
|
-
|
88
|
-
def build_contact(element, type)
|
89
|
-
reg=Record::Contact.new(:type => type)
|
90
|
-
content_for_scanner.scan(/(#{element}.*):\s*(.+)\n/).map do |entry|
|
91
|
-
reg["name"]=entry[1] if entry[0].strip == "Registrant"
|
92
|
-
reg["address"]=entry[1] if entry[0]=~ /Address/i
|
93
|
-
reg["zip"]=entry[1] if entry[0]=~ /Zip\sCode/i
|
94
|
-
end
|
95
|
-
return reg
|
96
|
-
end
|
97
|
-
|
98
|
-
end
|
99
|
-
end
|
100
|
-
end
|
101
|
-
end
|
@@ -1,129 +0,0 @@
|
|
1
|
-
#--
|
2
|
-
# Ruby Whois
|
3
|
-
#
|
4
|
-
# An intelligent pure Ruby WHOIS client and parser.
|
5
|
-
#
|
6
|
-
# Copyright (c) 2009-2012 Simone Carletti <weppos@weppos.net>
|
7
|
-
#++
|
8
|
-
|
9
|
-
|
10
|
-
require 'whois/record/parser/base'
|
11
|
-
|
12
|
-
|
13
|
-
module Whois
|
14
|
-
class Record
|
15
|
-
class Parser
|
16
|
-
|
17
|
-
#
|
18
|
-
# = whois.nic.tel parser
|
19
|
-
#
|
20
|
-
# Parser for the whois.nic.tel server.
|
21
|
-
#
|
22
|
-
# NOTE: This parser is just a stub and provides only a few basic methods
|
23
|
-
# to check for domain availability and get domain status.
|
24
|
-
# Please consider to contribute implementing missing methods.
|
25
|
-
# See WhoisNicIt parser for an explanation of all available methods
|
26
|
-
# and examples.
|
27
|
-
#
|
28
|
-
class WhoisNicTel < Base
|
29
|
-
|
30
|
-
property_supported :status do
|
31
|
-
if available?
|
32
|
-
:available
|
33
|
-
else
|
34
|
-
:registered
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
property_supported :available? do
|
39
|
-
!!(content_for_scanner =~ /Not found:/)
|
40
|
-
end
|
41
|
-
|
42
|
-
property_supported :registered? do
|
43
|
-
!available?
|
44
|
-
end
|
45
|
-
|
46
|
-
|
47
|
-
property_supported :created_on do
|
48
|
-
if content_for_scanner =~ /Domain Registration Date:\s+(.*)\n/
|
49
|
-
Time.parse($1)
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
property_supported :updated_on do
|
54
|
-
if content_for_scanner =~ /Domain Last Updated Date:\s+(.*)\n/
|
55
|
-
Time.parse($1)
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
property_supported :expires_on do
|
60
|
-
if content_for_scanner =~ /Domain Expiration Date:\s+(.*)\n/
|
61
|
-
Time.parse($1)
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
property_supported :nameservers do
|
66
|
-
content_for_scanner.scan(/Name Server:\s+(.+)\n/).flatten.map do |name|
|
67
|
-
Record::Nameserver.new(:name => name.downcase)
|
68
|
-
end
|
69
|
-
end
|
70
|
-
|
71
|
-
# The following methods are implemented by Yang Li on 12/19/2012
|
72
|
-
# ----------------------------------------------------------------------------
|
73
|
-
property_supported :domain do
|
74
|
-
return $1 if content_for_scanner =~ /Domain Name:\s+(.*)\n/i
|
75
|
-
end
|
76
|
-
|
77
|
-
property_supported :domain_id do
|
78
|
-
return $1 if content_for_scanner =~ /Domain ID:\s+(.*)\n/i
|
79
|
-
end
|
80
|
-
|
81
|
-
property_supported :registrar do
|
82
|
-
reg=Record::Registrar.new
|
83
|
-
content_for_scanner.scan(/^(.*Registrar.*):\s+(.+)\n/).map do |entry|
|
84
|
-
reg["id"] = entry[1] if entry[0] =~ /Sponsoring Registrar IANA ID/i
|
85
|
-
reg["name"] = entry[1] if entry[0] =~ /Sponsoring Registrar$/i
|
86
|
-
reg["organization"] = entry[1] if entry[0] =~ /Sponsoring Registrar$/i
|
87
|
-
reg["url"] = entry[1] if entry[0] =~ /URL/i
|
88
|
-
end
|
89
|
-
return reg
|
90
|
-
end
|
91
|
-
|
92
|
-
property_supported :registrant_contacts do
|
93
|
-
build_contact("Registrant", Whois::Record::Contact::TYPE_REGISTRANT)
|
94
|
-
end
|
95
|
-
|
96
|
-
property_supported :admin_contacts do
|
97
|
-
build_contact("Administrative Contact", Whois::Record::Contact::TYPE_ADMIN)
|
98
|
-
end
|
99
|
-
|
100
|
-
property_supported :technical_contacts do
|
101
|
-
build_contact("Technical Contact", Whois::Record::Contact::TYPE_TECHNICAL)
|
102
|
-
end
|
103
|
-
|
104
|
-
private
|
105
|
-
|
106
|
-
def build_contact(element, type)
|
107
|
-
reg=Record::Contact.new(:type => type)
|
108
|
-
content_for_scanner.scan(/^(#{element}.*):\s+(.+)\n/).map do |entry|
|
109
|
-
reg["id"]=entry[1] if entry[0] =~ /#{element}\sID/i
|
110
|
-
reg["name"]=entry[1] if entry[0] =~ /#{element}\sName/i
|
111
|
-
reg["organization"]=entry[1] if entry[0]=~ /#{element}\sOrganization/i
|
112
|
-
reg["address"]=entry[1] if entry[0]=~ /#{element}\sAddress1/i
|
113
|
-
reg["city"]= entry[1] if entry[0]=~ /#{element}\sCity/i
|
114
|
-
reg["zip"]=entry[1] if entry[0]=~ /#{element}\sPostal\sCode/i
|
115
|
-
reg["state"]=entry[1] if entry[0]=~ /#{element}\sState\/Province/i
|
116
|
-
reg["country"]=entry[1] if entry[0]=~ /#{element}\sCountry$/i
|
117
|
-
reg["country_code"]=entry[1] if entry[0]=~ /#{element}\sCountry\sCode/i
|
118
|
-
reg["phone"]=entry[1] if entry[0]=~ /#{element}\sPhone\sNumber/i
|
119
|
-
reg["fax"]=entry[1] if entry[0]=~ /#{element}\sFacsimile\sNumber/i
|
120
|
-
reg["email"]=entry[1] if entry[0]=~ /#{element}\sEmail/i
|
121
|
-
end
|
122
|
-
return reg
|
123
|
-
end
|
124
|
-
# ----------------------------------------------------------------------------
|
125
|
-
|
126
|
-
end
|
127
|
-
end
|
128
|
-
end
|
129
|
-
end
|
@@ -1,133 +0,0 @@
|
|
1
|
-
#--
|
2
|
-
# Ruby Whois
|
3
|
-
#
|
4
|
-
# An intelligent pure Ruby WHOIS client and parser.
|
5
|
-
#
|
6
|
-
# Copyright (c) 2009-2012 Simone Carletti <weppos@weppos.net>
|
7
|
-
#++
|
8
|
-
|
9
|
-
require 'whois/record/parser/base'
|
10
|
-
|
11
|
-
module Whois
|
12
|
-
class Record
|
13
|
-
class Parser
|
14
|
-
|
15
|
-
#
|
16
|
-
# = whois.nic.tr parser
|
17
|
-
#
|
18
|
-
# Parser for the whois.nic.tr server.
|
19
|
-
#
|
20
|
-
# NOTE: This parser is just a stub and provides only a few basic methods
|
21
|
-
# to check for domain availability and get domain status.
|
22
|
-
# Please consider to contribute implementing missing methods.
|
23
|
-
# See WhoisNicIt parser for an explanation of all available methods
|
24
|
-
# and examples.
|
25
|
-
#
|
26
|
-
class WhoisNicTr < Base
|
27
|
-
|
28
|
-
property_supported :status do
|
29
|
-
if available?
|
30
|
-
:available
|
31
|
-
else
|
32
|
-
:registered
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
property_supported :available? do
|
37
|
-
!!(content_for_scanner =~ /No match found for "(.+)"/)
|
38
|
-
end
|
39
|
-
|
40
|
-
property_supported :registered? do
|
41
|
-
!available?
|
42
|
-
end
|
43
|
-
|
44
|
-
property_supported :created_on do
|
45
|
-
if content_for_scanner =~ /Created on\.+:\s+(.+)\n/
|
46
|
-
time = Time.parse($1)
|
47
|
-
Time.utc(time.year, time.month, time.day)
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
property_not_supported :updated_on
|
52
|
-
|
53
|
-
property_supported :expires_on do
|
54
|
-
if content_for_scanner =~ /Expires on\.+:\s+(.+)\n/
|
55
|
-
time = Time.parse($1)
|
56
|
-
Time.utc(time.year, time.month, time.day)
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
property_supported :nameservers do
|
61
|
-
if content_for_scanner =~ /Domain Servers:\n((.+\n)+)\n/
|
62
|
-
$1.split("\n").map do |line|
|
63
|
-
name, ipv4 = line.split(/\s+/)
|
64
|
-
Record::Nameserver.new(:name => name, :ipv4 => ipv4)
|
65
|
-
end
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
# The following methods are implemented by Yang Li on 02/05/2013
|
70
|
-
# ----------------------------------------------------------------------------
|
71
|
-
property_not_supported :domain
|
72
|
-
|
73
|
-
property_not_supported :domain_id
|
74
|
-
|
75
|
-
property_not_supported :registrar
|
76
|
-
|
77
|
-
property_supported :admin_contacts do
|
78
|
-
build_contact("Administrative Contact", Whois::Record::Contact::TYPE_ADMIN)
|
79
|
-
end
|
80
|
-
|
81
|
-
property_supported :registrant_contacts do
|
82
|
-
build_contact_1("Registrant", Whois::Record::Contact::TYPE_REGISTRANT)
|
83
|
-
end
|
84
|
-
|
85
|
-
property_supported :technical_contacts do
|
86
|
-
build_contact("Technical Contact", Whois::Record::Contact::TYPE_TECHNICAL)
|
87
|
-
end
|
88
|
-
|
89
|
-
property_supported :billing_contacts do
|
90
|
-
build_contact("Billing Contact", Whois::Record::Contact::TYPE_BILLING)
|
91
|
-
end
|
92
|
-
|
93
|
-
private
|
94
|
-
|
95
|
-
def build_contact(element, type)
|
96
|
-
reg=Record::Contact.new(:type => type)
|
97
|
-
if content_for_scanner =~ /#{element}:\n((.+\n)+)\n\n/i
|
98
|
-
$1.scan(/(.+):(.+)\n/).map do |entry|
|
99
|
-
reg["id"]=entry[1].strip if entry[0] =~ /NIC Handle/i
|
100
|
-
reg["name"]=entry[1].strip if entry[0] =~ /Name/i
|
101
|
-
reg["organization"]=entry[1].strip if entry[0]=~ /Organization/i
|
102
|
-
reg["address"]=entry[1].strip if entry[0]=~ /Address/i
|
103
|
-
reg["phone"]=entry[1].strip if entry[0]=~ /Phone/i
|
104
|
-
reg["fax"]=entry[1].strip if entry[0]=~ /Fax/i
|
105
|
-
end
|
106
|
-
end
|
107
|
-
return reg
|
108
|
-
end
|
109
|
-
|
110
|
-
def build_contact_1(element, type)
|
111
|
-
reg=Record::Contact.new(:type => type)
|
112
|
-
if content_for_scanner =~ /#{element}:\n((.+\n)+)\n\n/i
|
113
|
-
line_num=1
|
114
|
-
$1.split(%r{\n}).each do |line|
|
115
|
-
reg["name"]=line.strip if line_num==1
|
116
|
-
reg["organization"]=line.strip if line_num==1
|
117
|
-
reg["address"]=line.strip if line_num==2
|
118
|
-
reg["city"]=line.strip if line_num==3
|
119
|
-
reg["country"]=line.strip if line_num==5
|
120
|
-
reg["email"]=line.strip if line=~ /\w+\@\w+\.\w+/
|
121
|
-
reg["phone"]=line.strip if line_num==7
|
122
|
-
reg["fax"]=line.strip if line_num==8
|
123
|
-
line_num=line_num+1
|
124
|
-
end
|
125
|
-
end
|
126
|
-
return reg
|
127
|
-
end
|
128
|
-
# ----------------------------------------------------------------------------
|
129
|
-
|
130
|
-
end
|
131
|
-
end
|
132
|
-
end
|
133
|
-
end
|