Subversion Repositories vgwhois

Rev

Rev 5 | Go to most recent revision | 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: bi TLD whois
5
#  Subprogram: bi 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://whois.nic.bi/register/whois.hei"; # TODO: https?
30
my $host = "http://whois.nic.bi/register/whois.hei"; # 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
# Get session URL
36
# Get session URL
37
my ($text, $exitcode) = GWhoIs::Core::wwwsgrep($host,'name="card" value="(.*?)');
37
my ($text, $exitcode) = VGWhoIs::Core::wwwsgrep($host,'name="card" value="(.*?)');
38
if ($exitcode) {
38
if ($exitcode) {
39
	# print STDERR "Query to web server failed.\n";
39
	# print STDERR "Query to web server failed.\n";
40
	print $text;
40
	print $text;
41
	exit $exitcode;
41
	exit $exitcode;
42
}
42
}
43
 
43
 
44
# Get lookup
44
# Get lookup
45
($text, $exitcode) = GWhoIs::Core::doquery($query,'cgi',"$host?card=$text&f_1.qdomain=$query&f_1.type=domain&f_1.q=Search");
45
($text, $exitcode) = VGWhoIs::Core::doquery($query,'cgi',"$host?card=$text&f_1.qdomain=$query&f_1.type=domain&f_1.q=Search");
46
 
46
 
47
if ($exitcode) {
47
if ($exitcode) {
48
	# print STDERR "Query to web server failed.\n";
48
	# print STDERR "Query to web server failed.\n";
49
}
49
}
50
 
50