Rev 17 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 17 | 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 20... | Line 20... | ||
20 | sub VGWhoIs::Utils::lynxsource { |
20 | sub VGWhoIs::Utils::lynxsource { |
21 | my ($url) = @_; |
21 | my ($url) = @_; |
22 | $url = quotemeta($url); |
22 | $url = quotemeta($url); |
23 | # LYNX sometimes hangs in combination with TOR |
23 | # LYNX sometimes hangs in combination with TOR |
24 | # return qx{lynx -connect_timeout=10 -source $url}; |
24 | # return qx{lynx -connect_timeout=10 -source $url}; |
25 | return qx{curl --user-agent "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0" --silent --max-time 10 $url}; |
25 | return qx{curl --insecure --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36" --silent --max-time 10 $url}; |
- | 26 | } |
|
- | 27 | ||
- | 28 | sub VGWhoIs::Utils::lynxrender { |
|
- | 29 | my ($url) = @_; |
|
- | 30 | $url = quotemeta($url); |
|
- | 31 | ||
- | 32 | use File::Basename; |
|
- | 33 | my $script_dir = undef; |
|
- | 34 | if(-l __FILE__) { |
|
- | 35 | $script_dir = dirname(readlink(__FILE__)); |
|
- | 36 | } else { |
|
- | 37 | $script_dir = dirname(__FILE__); |
|
- | 38 | } |
|
- | 39 | $script_dir = quotemeta($script_dir); |
|
- | 40 | ||
- | 41 | my $result = qx{lynx -cfg $script_dir/../lynx.cfg -dump -connect_timeout=10 $url 2>&1}; |
|
- | 42 | $result .= "FAILED with exit code $?\n\n" if $?; |
|
- | 43 | return $result; |
|
26 | } |
44 | } |
27 | 45 | ||
28 | # $line = htmlpre($line); |
46 | # $line = htmlpre($line); |
29 | sub VGWhoIs::Utils::htmlpre { |
47 | sub VGWhoIs::Utils::htmlpre { |
30 | my ($line) = @_; |
48 | my ($line) = @_; |