Subversion Repositories vgwhois

Rev

Rev 11 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 11 Rev 149
Line 3... Line 3...
3
 
3
 
4
#
4
#
5
#  VGWhoIs (ViaThinkSoft Global WhoIs, a fork of generic Whois / gwhois)
5
#  VGWhoIs (ViaThinkSoft Global WhoIs, a fork of generic Whois / gwhois)
6
#  Subprogram: tt TLD whois
6
#  Subprogram: tt TLD whois
7
#
7
#
8
#  (c) 2011 by Daniel Marschall, ViaThinkSoft <info@daniel-marschall.de>
8
#  (c) 2011-2024 by Daniel Marschall, ViaThinkSoft <info@daniel-marschall.de>
9
#
9
#
10
#  License: https://www.gnu.org/licenses/gpl-2.0.html (GPL version 2)
10
#  License: https://www.gnu.org/licenses/gpl-2.0.html (GPL version 2)
11
#
11
#
12
 
12
 
13
require_once __DIR__ . '/../../shared/php_includes/common_functions.inc.php';
13
require_once __DIR__ . '/../../shared/php_includes/common_functions.inc.php';
14
 
14
 
-
 
15
ini_set('default_charset', 'UTF-8');
-
 
16
 
15
$domain = isset($argv[1]) ? $argv[1] : '';
17
$domain = isset($argv[1]) ? $argv[1] : '';
16
 
18
 
17
$url = "https://www.nic.tt/cgi-bin/search.pl";
19
$url = "https://www.nic.tt/cgi-bin/search.pl";
18
$post = "name=$domain";
20
$post = "name=$domain";
19
 
21
 
20
$res = "% Parsing via regex from '$url' with post parameters '$post'\n\n";
22
$res = "% Parsing via regex from '$url' with post parameters '$post'\n\n";
21
 
23
 
22
$x = file_get_contents2($url, $post);
24
$x = file_get_contents2($url, $post);
23
 
25
 
24
preg_match_all('|<div id="main">(.*)<div id="foot">|ismU', $x, $m);
26
preg_match_all('|<div class="main">(.*)<div id="foot">|ismU', $x, $m);
-
 
27
if (!isset($m[1][0])) {
-
 
28
	echo "Error while parsing the web content (RegEx failed).\n";
-
 
29
	exit(1);
-
 
30
}
25
 
31
 
26
$x = $m[1][0];
32
$x = $m[1][0];
27
 
33
 
-
 
34
$x = str_replace("under <a href='https://www.nic.tt/cgi-bin/status.pl'>Retrieve->Domain Details</a>", "here: https://www.nic.tt/cgi-bin/status.pl", $x);
-
 
35
 
28
# The Domain Name <font color=red>nia.tt</font> is available.
36
# The Domain Name <font color=red>nia.tt</font> is available.
29
$x = str_replace('<font color=red>', '', $x);
37
$x = str_replace('<font color=red>', '', $x);
30
$x = str_replace('</font>', '', $x);
38
$x = str_replace('</font>', '', $x);
31
 
39
 
32
# Entferne, wenn möglich:
40
# Entferne, wenn möglich:
33
# Domain Search Form
41
# Domain Search Form
34
# Enter Domain Name:
42
# Enter Domain Name:
35
$bry = explode('</form>', $x, 2);
43
$bry = explode('</form>', $x, 2);
36
$x = $bry[count($bry)-1];
44
$x = $bry[count($bry)-1];
37
 
45
 
Line 57... Line 65...
57
	'Domain Name',
65
	'Domain Name',
58
	'Registrant Name',
66
	'Registrant Name',
59
	'Registrant Address',
67
	'Registrant Address',
60
	'DNS Hostnames',
68
	'DNS Hostnames',
61
	'DNS IP Addresses',
69
	'DNS IP Addresses',
-
 
70
	'Registration Date',
62
	'Expiration Date',
71
	'Expiration Date',
63
	'Administrative Contact',
72
	'Administrative Contact',
64
	'Technical Contact',
73
	'Technical Contact',
65
	'Billing Contact'
74
	'Billing Contact'
66
);
75
);
67
 
76
 
68
foreach ($special_words as $s) {
77
foreach ($special_words as $s) {
69
	$x = str_replace("\n$s\n", "\n\n".strtoupper($s)."\n\n", $x);
78
	$x = str_replace("\n$s\n", "\n\n".mb_strtoupper($s)."\n\n", $x);
70
}
79
}
71
 
80
 
72
$x = trim($x);
81
$x = trim($x);
73
 
82
 
74
echo $res.trim_each_line($x)."\n";
83
echo $res.trim_each_line($x)."\n";