Login | ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/vgwhois/trunk/main/subprograms/bd
Revision: 21
Committed: Tue May 28 12:59:24 2019 UTC (14 months, 2 weeks ago) by daniel-marschall
File size: 960 byte(s)
Log Message:
Fixed a lot of patterns

File Contents

# Content
1 #!/usr/bin/php
2 <?php
3
4 #
5 # VGWhoIs (ViaThinkSoft Global WhoIs, a fork of generic Whois / gwhois)
6 # Subprogram: bd TLD whois
7 #
8 # (c) 2019 by Daniel Marschall, ViaThinkSoft <info@daniel-marschall.de>
9 #
10 # License: https://www.gnu.org/licenses/gpl-2.0.html (GPL version 2)
11 #
12
13 require_once __DIR__ . '/../../shared/php_includes/common_functions.inc.php';
14
15 $domain = isset($argv[1]) ? $argv[1] : '';
16
17 if (preg_match('@(.*)(\.bd)@isU', $domain, $m)) {
18 $domain_without_tld = $m[1];
19 } else {
20 echo "'$domain' is not a valid .bd domain.\n";
21 exit(2);
22 }
23
24 $url = 'https://www.registry.com.bd/whois.php?dName='.urlencode($domain_without_tld).'&Submit=Lookup+';
25
26 $cont = file_get_contents($url);
27
28 if (preg_match('@<h3 class="block-head">Result</h3>(.+)</div>@ismU', $cont, $m)) {
29 $cont = $m[1];
30 }
31
32 $cont = strip_tags($cont);
33 $cont = preg_replace("@\n\n+@", "\n", $cont);
34 $cont = trim($cont);
35
36 echo "Information about $domain extracted from $url:\n\n";
37 echo $cont."\n";