Subversion Repositories vgwhois

Rev

Rev 5 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5 Rev 11
Line 1... Line 1...
1
#!/usr/bin/perl
1
#!/usr/bin/perl
2
 
2
 
3
#
3
#
4
#  VWhois (ViaThinkSoft WHOIS, a fork of generic Whois / gwhois)
4
#  VGWhoIs (ViaThinkSoft Global WhoIs, a fork of generic Whois / gwhois)
5
#  Subprogram: bz TLD whois
5
#  Subprogram: bz TLD whois
6
#
6
#
7
#  (c) 2015 by Daniel Marschall, ViaThinkSoft <info@daniel-marschall.de>
7
#  (c) 2015 by Daniel Marschall, ViaThinkSoft <info@daniel-marschall.de>
8
#
8
#
9
#  License: https://www.gnu.org/licenses/gpl-2.0.html (GPL version 2)
9
#  License: https://www.gnu.org/licenses/gpl-2.0.html (GPL version 2)
Line 13... Line 13...
13
use strict;
13
use strict;
14
use utf8;
14
use utf8;
15
 
15
 
16
use FindBin;
16
use FindBin;
17
use lib "$FindBin::RealBin/../../lib/";
17
use lib "$FindBin::RealBin/../../lib/";
18
use GWhoIs::Core;
18
use VGWhoIs::Core;
19
 
19
 
20
if (defined $ARGV[0]) {
20
if (defined $ARGV[0]) {
21
	$_ = join(' ', @ARGV);
21
	$_ = join(' ', @ARGV);
22
} else {
22
} else {
23
	# If no parameter is given, await an input from STDIN
23
	# If no parameter is given, await an input from STDIN
Line 27... Line 27...
27
 
27
 
28
my $query = $_;
28
my $query = $_;
29
 
29
 
30
my $host = "http://www.belizenic.bz/cgi-bin/Registrar_test?action=whois&action2=whois&domain="; # TODO: https?
30
my $host = "http://www.belizenic.bz/cgi-bin/Registrar_test?action=whois&action2=whois&domain="; # TODO: https?
31
 
31
 
32
my ($protocol, $hostname) = GWhoIs::Utils::splitProtocolHost($host);
32
my ($protocol, $hostname) = VGWhoIs::Utils::splitProtocolHost($host);
33
 
33
 
34
#print "Querying $hostname with $protocol.\n";
34
#print "Querying $hostname with $protocol.\n";
35
 
35
 
36
my $hexstring;
36
my $hexstring;
37
$hexstring = $query;
37
$hexstring = $query;
38
$hexstring =~ s/./sprintf("%02x",ord("$&"))/eg;
38
$hexstring =~ s/./sprintf("%02x",ord("$&"))/eg;
39
 
39
 
40
my ($text, $exitcode) = GWhoIs::Core::doquery($query,'cgi',$host.$hexstring,'');
40
my ($text, $exitcode) = VGWhoIs::Core::doquery($query,'cgi',$host.$hexstring,'');
41
 
41
 
42
if ($exitcode) {
42
if ($exitcode) {
43
	# print STDERR "Query to web server failed.\n";
43
	# print STDERR "Query to web server failed.\n";
44
}
44
}
45
 
45