Subversion Repositories vgwhois

Rev

Rev 11 | 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: gu TLD whois
2 daniel-mar 7
#
5 daniel-mar 8
#  (c) 2013 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
# TODO: check if all preg_match() did succeed
14
# TODO: check if the query did output exactly 1 record.
15
# TODO: Is there any better way to retrieve the information of a domain without full text search engine?
16
 
22 daniel-mar 17
# DM 28.05.2019 : "This page is undergoing construction. This page is temporary. Thank you for your patience."
18
#                 TODO: Wait if it comes back
19
 
2 daniel-mar 20
require_once __DIR__ . '/../../shared/php_includes/common_functions.inc.php';
21
 
22
$domain = isset($argv[1]) ? $argv[1] : '';
23
 
24
$url = 'http://gadao.gov.gu/Scripts/dtSearch/dtisapi.dll';
25
 
26
$post = 'cmd=search&SearchForm=C:\Inetpub\wwwroot\domainsearch_form.htm&request=Domain%20name:%20'.rawurlencode($domain).'&index=C:\dtSearch\BIN\domain&maxFiles=25&stemming=Yes';
27
 
28
$cont = file_get_contents2($url, $post);
29
 
30
if (!preg_match('@target="doc">(.*)\\.htm</A>@ismU', $cont, $m)) {
31
	echo "Domain $domain not found or the parsing script is outdated.\n";
32
	exit(1);
33
}
34
$a = $m[1];
35
$url2 = "http://gadao.gov.gu/domain/$a.htm";
36
 
37
preg_match('@<TD align=right>((\\d+)/(\\d+)/(\\d+))</TD>@ismU', $cont, $m);
38
//$moddate = $m[1];
39
$month = $m[2];
40
$day   = $m[3];
41
$year  = $m[4];
42
$moddate = date('Y-m-d', mktime(0, 0, 0, $month, $day, $year));
43
 
44
$cont2 = file_get_contents2($url2);
45
preg_match('@<pre>(.+)</pre>@ismU', $cont2, $m);
46
 
47
echo "Content of $url2 (Last modified: $moddate)\n\n";
48
echo trim(html_entity_decode($m[1]))."\n";