Subversion Repositories vgwhois

Compare Revisions

No changes between revisions

Regard whitespace Rev 1 → Rev 2

/trunk/main/subprograms/vi
0,0 → 1,42
#!/usr/bin/php
<?php
 
#
# generic Whois - Subprogram "vi"
#
# (c) 2013 by Daniel Marschall, ViaThinkSoft <www.viathinksoft.de>
#
# Distribution, usage etc. pp. regulated by the current version of GPL.
#
#
#
# History:
# 2013-07-25 mar Initial release
#
 
require_once __DIR__ . '/../../shared/php_includes/common_functions.inc.php';
 
$domain = isset($argv[1]) ? $argv[1] : '';
 
$url = 'https://secure.nic.vi/whois-lookup/';
 
$post = 'submitted=true&domainName='.rawurlencode($domain);
 
$cont = file_get_contents2($url, $post);
 
if (preg_match('@<div class="results">(.+)</div>@ismU', $cont, $m)) {
$cont = $m[1];
}
 
// There is a "secret" field named "Name". Why hide it?
$cont = str_replace('<!--', '', $cont);
$cont = str_replace('-->', '', $cont);
 
$cont = html_entity_decode(strip_tags($cont));
 
// Remove whitespaces at the beginning of each line
$cont = preg_replace('@([\r\n])[ \t]+(\S)@isU', '\\1\\2', $cont);
$cont = trim($cont);
 
echo "Information about $domain extracted from $url:\n\n";
echo $cont."\n";
Property changes:
Added: svn:executable
+*
\ No newline at end of property