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: bm TLD whois |
5 | # Subprogram: bm 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 28... | Line 28... | ||
28 | my $query = $_; |
28 | my $query = $_; |
29 | 29 | ||
30 | # my $host = "http://207.228.133.14/cgi-bin/lansaweb?procfun+BMWHO+BMWHO2+WHO"; |
30 | # my $host = "http://207.228.133.14/cgi-bin/lansaweb?procfun+BMWHO+BMWHO2+WHO"; |
31 | my $host = "http://www.bermudanic.bm/cgi-bin/lansaweb?procfun+BMWHO+BMWHO2+WHO"; # TODO: https? |
31 | my $host = "http://www.bermudanic.bm/cgi-bin/lansaweb?procfun+BMWHO+BMWHO2+WHO"; # TODO: https? |
32 | 32 | ||
33 | my ($protocol, $hostname) = GWhoIs::Utils::splitProtocolHost($host); |
33 | my ($protocol, $hostname) = VGWhoIs::Utils::splitProtocolHost($host); |
34 | 34 | ||
35 | #print "Querying $hostname with $protocol.\n"; |
35 | #print "Querying $hostname with $protocol.\n"; |
36 | 36 | ||
37 | # Get session URL |
37 | # Get session URL |
38 | my ($text, $exitcode) = GWhoIs::Core::wwwsgrep($host,'ACTION="(.*?)"'); |
38 | my ($text, $exitcode) = VGWhoIs::Core::wwwsgrep($host,'ACTION="(.*?)"'); |
39 | if ($exitcode) { |
39 | if ($exitcode) { |
40 | # print STDERR "Query to web server failed.\n"; |
40 | # print STDERR "Query to web server failed.\n"; |
41 | print $text; |
41 | print $text; |
42 | exit $exitcode; |
42 | exit $exitcode; |
43 | } |
43 | } |
44 | 44 | ||
45 | # Get lookup |
45 | # Get lookup |
46 | ($text, $exitcode) = GWhoIs::Core::doquery($query,'cgipost',"$protocol://$hostname$text", |
46 | ($text, $exitcode) = VGWhoIs::Core::doquery($query,'cgipost',"$protocol://$hostname$text", |
47 | "ADOM++++++=$query&_PROCESS=BMWHO+&_FUNCTION=BMWHO2+"); |
47 | "ADOM++++++=$query&_PROCESS=BMWHO+&_FUNCTION=BMWHO2+"); |
48 | 48 | ||
49 | if ($exitcode) { |
49 | if ($exitcode) { |
50 | # print STDERR "Query to web server failed.\n"; |
50 | # print STDERR "Query to web server failed.\n"; |
51 | } |
51 | } |