Subversion Repositories vgwhois

Rev

Rev 20 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 20 Rev 92
Line 1... Line 1...
1
#
1
#
2
#  VGWhoIs (ViaThinkSoft Global WhoIs, a fork of generic Whois / gwhois)
2
#  VGWhoIs (ViaThinkSoft Global WhoIs, a fork of generic Whois / gwhois)
3
#  Main program
3
#  Main program
4
#
4
#
5
#  (c) 2010-2019 by Daniel Marschall, ViaThinkSoft <info@daniel-marschall.de>
5
#  (c) 2010-2022 by Daniel Marschall, ViaThinkSoft <info@daniel-marschall.de>
6
#  based on the code (c) 1998-2010 by Juliane Holzt <debian@kju.de>
6
#  based on the code (c) 1998-2010 by Juliane Holzt <debian@kju.de>
7
#  Some early parts by Lutz Donnerhacke <Lutz.Donnerhacke@Jena.Thur.de>
7
#  Some early parts by Lutz Donnerhacke <Lutz.Donnerhacke@Jena.Thur.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)
10
#
10
#
Line 332... Line 332...
332
        }
332
        }
333
 
333
 
334
        elsif ($method eq 'cgi') {
334
        elsif ($method eq 'cgi') {
335
                my ($protocol, $hostname) = VGWhoIs::Utils::splitProtocolHost($host);
335
                my ($protocol, $hostname) = VGWhoIs::Utils::splitProtocolHost($host);
336
 
336
 
337
                print "Querying $hostname ($protocol) with cgi.\n\n";
337
                print "Querying $hostname ($protocol) with cgi:\n$host\n\n";
338
#!!
338
 
339
#               print "$host\n";
339
                $result = VGWhoIs::Utils::lynxrender($host);
-
 
340
 
340
 
341
 
341
# TODO: lynx seems to be better in some ways!
342
# Old:
342
#       For example, a website that outputs "text/plain" will be rendered correct in lynx!
-
 
343
#               $result = `lynx -connect_timeout=10 -dump "$host" 2>&1`;
-
 
344
#               $result .= "FAILED with exit code $?\n\n" if $?;
-
 
345
 
343
 
346
#               $result = `curl --max-time 10 --stderr /dev/null "$host" 2>&1`; # TODO escape
344
#               $result = `curl --max-time 10 --stderr /dev/null "$host" 2>&1`; # TODO escape
347
 
345
 
348
                # TODO: VGWhoIs::Core::getsource ok? war vorher IMMER lynx
346
                # TODO: VGWhoIs::Core::getsource ok? war vorher IMMER lynx
349
                my ($loc_text, $loc_exitcode) = VGWhoIs::Core::getsource($host);
347
#               my ($loc_text, $loc_exitcode) = VGWhoIs::Core::getsource($host);
-
 
348
 
-
 
349
#               $exitcode = max($exitcode, $loc_exitcode);
-
 
350
#               if ($loc_exitcode) {
-
 
351
#                       $result .= "Query to web server failed.\n";
-
 
352
#               } else {
-
 
353
#                       $result = VGWhoIs::Utils::render_html($loc_text);
-
 
354
#               }
350
 
355
 
351
                $exitcode = max($exitcode, $loc_exitcode);
-
 
352
                if ($loc_exitcode) {
-
 
353
                        $result .= "Query to web server failed.\n";
-
 
354
                } else {
-
 
355
                        $result = VGWhoIs::Utils::render_html($loc_text);
-
 
356
                }
-
 
357
        }
356
        }
358
 
357
 
359
        elsif ($method eq 'cgipost') {
358
        elsif ($method eq 'cgipost') {
360
                my ($protocol, $hostname) = VGWhoIs::Utils::splitProtocolHost($host);
359
                my ($protocol, $hostname) = VGWhoIs::Utils::splitProtocolHost($host);
361
 
360