Rev 5 | Blame | Compare with Previous | Last modification | View Log | RSS feed
#!/usr/bin/perl
#
# VGWhoIs (ViaThinkSoft Global WhoIs, a fork of generic Whois / gwhois)
# Subprogram: bz TLD whois
#
# (c) 2015 by Daniel Marschall, ViaThinkSoft <info@daniel-marschall.de>
#
# License: https://www.gnu.org/licenses/gpl-2.0.html (GPL version 2)
#
use warnings;
use strict;
use utf8;
use FindBin;
use lib "$FindBin::RealBin/../../lib/";
use VGWhoIs::Core;
if (defined $ARGV[0]) {
$_ = join(' ', @ARGV);
} else {
# If no parameter is given, await an input from STDIN
$_ = <>;
chomp;
}
my $query = $_;
my $host = "http://www.belizenic.bz/cgi-bin/Registrar_test?action=whois&action2=whois&domain="; # TODO: https?
my ($protocol, $hostname) = VGWhoIs::Utils::splitProtocolHost($host);
#print "Querying $hostname with $protocol.\n";
my $hexstring;
$hexstring = $query;
$hexstring =~ s/./sprintf("%02x",ord("$&"))/eg;
my ($text, $exitcode) = VGWhoIs::Core::doquery($query,'cgi',$host.$hexstring,'');
if ($exitcode) {
# print STDERR "Query to web server failed.\n";
}
print $text;
exit $exitcode;