From 173145bf67115a4ee68a80171d3cd2f874e296c0 Mon Sep 17 00:00:00 2001 From: Evgeny Sorokin Date: Tue, 25 Jun 2024 14:29:50 +0300 Subject: support .ws TLD in whois lookups --- src/ssl_expire_notifier.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/ssl_expire_notifier.php') diff --git a/src/ssl_expire_notifier.php b/src/ssl_expire_notifier.php index 7d881e2..2b674cb 100755 --- a/src/ssl_expire_notifier.php +++ b/src/ssl_expire_notifier.php @@ -5,6 +5,7 @@ require_once __DIR__.'/../vendor/autoload.php'; require_once __DIR__.'/lib/Logger.php'; use Iodev\Whois\Factory; +use Iodev\Whois\Modules\Tld\TldServer; error_reporting(E_ALL); ini_set('display_errors', 1); @@ -117,10 +118,15 @@ function ssl_expire_notifier() { } function whois_expire_notifier() { - $whois = Factory::get()->createWhois(); - $domains = get_top_domains(); foreach ($domains as $domain) { + $whois = Factory::get()->createWhois(); + + if (preg_match('/\.ws([:]\d+)?$/', $domain)) { + $customServer = new TldServer(".ws", "whois.website.ws", false, Factory::get()->createTldParser()); + $whois->getTldModule()->addServers([$customServer]); + } + $logger = new Logger($domain); try { $info = $whois->loadDomainInfo($domain); -- cgit v1.2.3