Rev 5 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2 | daniel-mar | 1 | #!/usr/bin/php |
2 | <?php |
||
3 | |||
4 | # |
||
11 | daniel-mar | 5 | # VGWhoIs (ViaThinkSoft Global WhoIs, a fork of generic Whois / gwhois) |
5 | daniel-mar | 6 | # Subprogram: hm TLD whois |
2 | daniel-mar | 7 | # |
5 | daniel-mar | 8 | # (c) 2018 by Daniel Marschall, ViaThinkSoft <info@daniel-marschall.de> |
2 | daniel-mar | 9 | # |
5 | daniel-mar | 10 | # License: https://www.gnu.org/licenses/gpl-2.0.html (GPL version 2) |
2 | daniel-mar | 11 | # |
12 | |||
13 | require_once __DIR__ . '/../../shared/php_includes/common_functions.inc.php'; |
||
14 | |||
15 | # The server whois.registry.hm is not available for the public anymore. |
||
16 | # The whois server runs internally, and can be accessed via the web interface. |
||
17 | |||
18 | $domain = isset($argv[1]) ? $argv[1] : ''; |
||
19 | |||
20 | # Please note that you first have to call the whois main page which sets a cookie that is required. |
||
21 | $cont = file_get_contents2("http://www.registry.hm/"); |
||
22 | |||
23 | # Now the real call |
||
24 | $cont = file_get_contents2("http://www.registry.hm/HR_whois2.php?domain_name=$domain"); |
||
25 | |||
26 | if (!preg_match('@<pre>(.+)</pre>@ismU', $cont, $m)) { |
||
27 | echo "Parse error\n"; |
||
28 | exit(1); |
||
29 | } |
||
30 | |||
31 | $cont = $m[1]; |
||
32 | |||
33 | $cont = str_replace('<br>', "\n", $cont); |
||
34 | |||
35 | echo $cont; |
||
36 |