Rev 22 | Blame | Compare with Previous | Last modification | View Log | RSS feed
#!/usr/bin/php
<?php
#
# VGWhoIs (ViaThinkSoft Global WhoIs, a fork of generic Whois / gwhois)
# Subprogram: gt TLD whois
#
# (c) 2011-2012 by Daniel Marschall, ViaThinkSoft <info@daniel-marschall.de>
#
# License: https://www.gnu.org/licenses/gpl-2.0.html (GPL version 2)
#
require_once __DIR__ . '/../../shared/php_includes/common_functions.inc.php';
ini_set('default_charset', 'UTF-8');
$domain = isset($argv[1]) ? $argv[1] : '';
$url = "http://www.gt/cgi-bin/whois.cgi?domain=$domain";
$res = "% Parsing via regex from '$url'\n\n";
$x = file_get_contents2($url);
$x = strip_tags($x);
# $x = preg_replace('|:\s*([^\s])|ismU', ': $1', $x);
$x = preg_replace('|^\s*([^\s])|ismU', '$1', $x);
$x = html_entity_decode($x);
$special_words = array(
'Información del Dominio'."\n".$domain,
'Contactos Administrativos',
'Contactos Técnicos',
'Servidores',
'Fecha de Expiración (dd/mm/aaaa)'
);
foreach ($special_words as $s) {
$x = str_replace($s, "\n".mb_strtoupper($s)."\n", $x);
}
$x = str_replace('Inicio', '', $x); // Back to mainpage
$x = str_replace('Primario', "Primario\n\n", $x);
$x = str_replace('Secundario', "Secundario\n\n", $x);
$x = trim($x);
echo $res.trim_each_line($x)."\n";