From: <chr...@us...> - 2018-02-09 13:32:49
|
Revision: 13330 http://sourceforge.net/p/xoops/svn/13330 Author: chronolabscoop Date: 2018-02-09 13:32:47 +0000 (Fri, 09 Feb 2018) Log Message: ----------- Internet WhoIS Services REST API - Version 2.2.11! Modified Paths: -------------- *.xoops.org (Subdomain APIs & Sites)/whois.xoops.org/README.md *.xoops.org (Subdomain APIs & Sites)/whois.xoops.org/class/whois.php Added Paths: ----------- *.xoops.org (Subdomain APIs & Sites)/whois.xoops.org/crons/ *.xoops.org (Subdomain APIs & Sites)/whois.xoops.org/crons/find-whois-services.php *.xoops.org (Subdomain APIs & Sites)/whois.xoops.org/crons/index.html Modified: *.xoops.org (Subdomain APIs & Sites)/whois.xoops.org/README.md =================================================================== --- *.xoops.org (Subdomain APIs & Sites)/whois.xoops.org/README.md 2018-02-09 13:13:24 UTC (rev 13329) +++ *.xoops.org (Subdomain APIs & Sites)/whois.xoops.org/README.md 2018-02-09 13:32:47 UTC (rev 13330) @@ -28,6 +28,21 @@ RewriteRule ^v([0-9]{1,2})/(.*?)/(json|xml|serial|raw|html).api$ ./index.php?version=$1&whois=$2&output=$3 [L,NC,QSA] +## Scheduled Cron Job Details., + +There is one or more cron jobs that is scheduled task that need to be added to your system kernel when installing this API, the following command is before you install the chronological jobs with crontab in debain/ubuntu + + Execute:- + $ sudo crontab -e + +### CronTab Entry: + + * */12 */20 * * /usr/bin/php -q /path/to/crons/find-whois-services.php + +## Licensing + + * This is released under General Public License 3 - GPL3 - Only! + # Installation Copy the contents of this archive/repository to the run time environment, configue apache2, ngix or iis to resolve the path of this repository and run the HTML Installer. Modified: *.xoops.org (Subdomain APIs & Sites)/whois.xoops.org/class/whois.php =================================================================== --- *.xoops.org (Subdomain APIs & Sites)/whois.xoops.org/class/whois.php 2018-02-09 13:13:24 UTC (rev 13329) +++ *.xoops.org (Subdomain APIs & Sites)/whois.xoops.org/class/whois.php 2018-02-09 13:32:47 UTC (rev 13330) @@ -265,29 +265,8 @@ $services = $this->_domain_whoisservers; if (!is_array($this->_domain_whoisservers = APICache::read('networking-whois-servers')) || count($this->_domain_whoisservers) == 0) { - set_time_limit(3600 * 4.75); - APICache::write('networking-whois-servers', APICache::read('networking-whois-servers-buffer'), 3600 * 24 * 7 * mt_rand(2, 9) * mt_rand(2, 9)); foreach(APICache::read('networking-whois-servers-buffer') as $realm => $service) $services[$realm] = $service; - - foreach($this->c_tld as $ctld) - { - if (!isset($services[$ctld])) - if ($service = $this->findWhoisService($ctld)) - $services[$ctld] = $service; - } - foreach($this->g_tld as $gtld) - { - if (!isset($services[$gtld])) - if ($service = $this->findWhoisService($gtld)) - $services[$gtld] = $service; - foreach($this->c_tld as $ctld) - { - if (!isset($services[$gtld.'.'.$ctld])) - if ($service = $this->findWhoisService($gtld.'.'.$ctld)) - $services[$gtld.'.'.$ctld] = $service; - } - } APICache::write('networking-whois-servers', $this->_domain_whoisservers = $services, 3600 * 24 * 7 * mt_rand(2, 9) * mt_rand(2, 9)); APICache::write('networking-whois-servers-buffer', $this->_domain_whoisservers = $services, 3600 * 24 * 7 * mt_rand(2, 9) * mt_rand(2, 9) * mt_rand(2, 9)); } @@ -310,22 +289,6 @@ session_commit(); } - /** - * Locates Whois Service with resource - * - * @param string $tld - * @return string|boolean - */ - private function findWhoisService($tld = '') - { - $uris = array('whois.nic.'.$tld, 'whois.'.$tld.'nic.'.$tld, 'whois.'.$tld.'nic.net.'.$tld); - foreach($uris as $uri) - { - if ($this->validateIPv4(gethostbyname($uri))) - return $uri; - } - return false; - } /** * lookupIP() @@ -554,4 +517,4 @@ return 'Error: Could not validate data as either a domain name or IPv4 or IPv6 address!'; } } -} +} \ No newline at end of file Added: *.xoops.org (Subdomain APIs & Sites)/whois.xoops.org/crons/find-whois-services.php =================================================================== --- *.xoops.org (Subdomain APIs & Sites)/whois.xoops.org/crons/find-whois-services.php (rev 0) +++ *.xoops.org (Subdomain APIs & Sites)/whois.xoops.org/crons/find-whois-services.php 2018-02-09 13:32:47 UTC (rev 13330) @@ -0,0 +1,233 @@ +<?php + +/** + * Locates Whois Service with resource + * + * @param string $tld + * @return string|boolean + */ +function findWhoisService($tld = '') +{ + $uris = array('whois.nic.'.$tld, 'whois.'.$tld.'nic.'.$tld, 'whois.'.$tld.'nic.net.'.$tld); + foreach($uris as $uri) + { + if (validateIPv4(gethostbyname($uri))) + return $uri; + } + return false; +} + +/** + * validateIPv4() + * Validates and IPv6 Address + * + * @param string $ip + * @return boolean + */ +function validateIPv4($ip) { + if(filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE) === FALSE) // returns IP is valid + { + return false; + } else { + return true; + } +} + +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . 'apiconfig.php'; + +$c_tld = array_keys(eval('?>'.getURIData(API_STRATA_API_URL."/v2/fallout/raw.api", 120, 120).'<?php')); +APICache::write('networking-fallout-nodes', $c_tld, 3600 * 24 * 7 * mt_rand(2, 9) * mt_rand(2, 9)); + +$g_tld = array_keys(eval('?>'.getURIData(API_STRATA_API_URL."/v2/strata/raw.api", 120, 120).'<?php')); +APICache::write('networking-strata-nodes', $g_tld, 3600 * 24 * 7 * mt_rand(2, 9) * mt_rand(2, 9)); + +$services = array( + "ac" =>"whois.nic.ac", + "ae" =>"whois.nic.ae", + "aero"=>"whois.aero", + "af" =>"whois.nic.af", + "ag" =>"whois.nic.ag", + "al" =>"whois.ripe.net", + "am" =>"whois.amnic.net", + "arpa" =>"whois.iana.org", + "as" =>"whois.nic.as", + "asia" =>"whois.nic.asia", + "at" =>"whois.nic.at", + "au" =>"whois.aunic.net", + "az" =>"whois.ripe.net", + "ba" =>"whois.ripe.net", + "be" =>"whois.dns.be", + "bg" =>"whois.register.bg", + "bi" =>"whois.nic.bi", + "biz" =>"whois.biz", + "bj" =>"whois.nic.bj", + "br" =>"whois.registro.br", + "bt" =>"whois.netnames.net", + "by" =>"whois.ripe.net", + "bz" =>"whois.belizenic.bz", + "ca" =>"whois.cira.ca", + "cat" =>"whois.cat", + "cc" =>"whois.nic.cc", + "cd" =>"whois.nic.cd", + "ch" =>"whois.nic.ch", + "ci" =>"whois.nic.ci", + "ck" =>"whois.nic.ck", + "cl" =>"whois.nic.cl", + "cn" =>"whois.cnnic.net.cn", + "com" =>"whois.verisign-grs.com", + "coop" =>"whois.nic.coop", + "cx" =>"whois.nic.cx", + "cy" =>"whois.ripe.net", + "cz" =>"whois.nic.cz", + "de" =>"whois.denic.de", + "dk" =>"whois.dk-hostmaster.dk", + "dm" =>"whois.nic.cx", + "dz" =>"whois.ripe.net", + "edu" =>"whois.educause.edu", + "ee" =>"whois.eenet.ee", + "eg" =>"whois.ripe.net", + "es" =>"whois.ripe.net", + "eu" =>"whois.eu", + "fi" =>"whois.ficora.fi", + "fo" =>"whois.ripe.net", + "fr" =>"whois.nic.fr", + "gb" =>"whois.ripe.net", + "gd" =>"whois.adamsnames.com", + "ge" =>"whois.ripe.net", + "gg" =>"whois.channelisles.net", + "gi" =>"whois2.afilias-grs.net", + "gl" =>"whois.ripe.net", + "gm" =>"whois.ripe.net", + "gov" =>"whois.nic.gov", + "gr" =>"whois.ripe.net", + "gs" =>"whois.nic.gs", + "gw" =>"whois.nic.gw", + "gy" =>"whois.registry.gy", + "hk" =>"whois.hkirc.hk", + "hm" =>"whois.registry.hm", + "hn" =>"whois2.afilias-grs.net", + "hr" =>"whois.ripe.net", + "hu" =>"whois.nic.hu", + "ie" =>"whois.domainregistry.ie", + "il" =>"whois.isoc.org.il", + "in" =>"whois.inregistry.net", + "info" =>"whois.afilias.net", + "int" =>"whois.iana.org", + "io" =>"whois.nic.io", + "iq" =>"vrx.net", + "ir" =>"whois.nic.ir", + "is" =>"whois.isnic.is", + "it" =>"whois.nic.it", + "je" =>"whois.channelisles.net", + "jobs" =>"jobswhois.verisign-grs.com", + "jp" =>"whois.jprs.jp", + "ke" =>"whois.kenic.or.ke", + "kg" =>"www.domain.kg", + "ki" =>"whois.nic.ki", + "kr" =>"whois.nic.or.kr", + "kz" =>"whois.nic.kz", + "la" =>"whois.nic.la", + "li" =>"whois.nic.li", + "lt" =>"whois.domreg.lt", + "lu" =>"whois.dns.lu", + "lv" =>"whois.nic.lv", + "ly" =>"whois.nic.ly", + "ma" =>"whois.iam.net.ma", + "mc" =>"whois.ripe.net", + "md" =>"whois.ripe.net", + "me" =>"whois.meregistry.net", + "mg" =>"whois.nic.mg", + "mil" =>"whois.nic.mil", + "mn" =>"whois.nic.mn", + "mobi" =>"whois.dotmobiregistry.net", + "ms" =>"whois.adamsnames.tc", + "mt" =>"whois.ripe.net", + "mu" =>"whois.nic.mu", + "museum" =>"whois.museum", + "mx" =>"whois.nic.mx", + "my" =>"whois.mynic.net.my", + "na" =>"whois.na-nic.com.na", + "name" =>"whois.nic.name", + "net" =>"whois.verisign-grs.net", + "nf" =>"whois.nic.nf", + "nl" =>"whois.domain-registry.nl", + "no" =>"whois.norid.no", + "nu" =>"whois.nic.nu", + "nz" =>"whois.srs.net.nz", + "org" =>"whois.pir.org", + "pl" =>"whois.dns.pl", + "pm" =>"whois.nic.pm", + "pr" =>"whois.uprr.pr", + "pro" =>"whois.registrypro.pro", + "pt" =>"whois.dns.pt", + "re" =>"whois.nic.re", + "ro" =>"whois.rotld.ro", + "ru" =>"whois.ripn.net", + "sa" =>"whois.nic.net.sa", + "sb" =>"whois.nic.net.sb", + "sc" =>"whois2.afilias-grs.net", + "se" =>"whois.iis.se", + "sg" =>"whois.nic.net.sg", + "sh" =>"whois.nic.sh", + "si" =>"whois.arnes.si", + "sk" =>"whois.ripe.net", + "sm" =>"whois.ripe.net", + "st" =>"whois.nic.st", + "su" =>"whois.ripn.net", + "tc" =>"whois.adamsnames.tc", + "tel" =>"whois.nic.tel", + "tf" =>"whois.nic.tf", + "th" =>"whois.thnic.net", + "tj" =>"whois.nic.tj", + "tk" =>"whois.dot.tk", + "tl" =>"whois.nic.tl", + "tm" =>"whois.nic.tm", + "tn" =>"whois.ripe.net", + "to" =>"whois.tonic.to", + "tp" =>"whois.nic.tl", + "tr" =>"whois.nic.tr", + "travel" =>"whois.nic.travel", + "tv" => "tvwhois.verisign-grs.com", + "tw" =>"whois.twnic.net.tw", + "ua" =>"whois.net.ua", + "ug" =>"whois.co.ug", + "uk" =>"whois.nic.uk", + "us" =>"whois.nic.us", + "uy" =>"nic.uy", + "uz" =>"whois.cctld.uz", + "va" =>"whois.ripe.net", + "vc" =>"whois2.afilias-grs.net", + "ve" =>"whois.nic.ve", + "vg" =>"whois.adamsnames.tc", + "wf" =>"whois.nic.wf", + "ws" =>"whois.website.ws", + "yt" =>"whois.nic.yt", + "yu" =>"whois.ripe.net" +); + +foreach(APICache::read('networking-whois-servers-buffer') as $realm => $service) + $services[$realm] = $service; + +foreach($c_tld as $ctld) +{ + if (!isset($services[$ctld])) + if ($service = findWhoisService($ctld)) + $services[$ctld] = $service; +} +foreach($g_tld as $gtld) +{ + if (!isset($services[$gtld])) + if ($service = findWhoisService($gtld)) + $services[$gtld] = $service; + foreach($c_tld as $ctld) + { + if (!isset($services[$gtld.'.'.$ctld])) + if ($service = findWhoisService($gtld.'.'.$ctld)) + $services[$gtld.'.'.$ctld] = $service; + } +} + +APICache::write('networking-whois-servers', $services, 3600 * 24 * 7 * mt_rand(2, 9) * mt_rand(2, 9)); +APICache::write('networking-whois-servers-buffer', $services, 3600 * 24 * 7 * mt_rand(2, 9) * mt_rand(2, 9) * mt_rand(2, 9)); + +?> \ No newline at end of file Added: *.xoops.org (Subdomain APIs & Sites)/whois.xoops.org/crons/index.html =================================================================== --- *.xoops.org (Subdomain APIs & Sites)/whois.xoops.org/crons/index.html (rev 0) +++ *.xoops.org (Subdomain APIs & Sites)/whois.xoops.org/crons/index.html 2018-02-09 13:32:47 UTC (rev 13330) @@ -0,0 +1 @@ +<script>history.go(-1);</script> Property changes on: *.xoops.org (Subdomain APIs & Sites)/whois.xoops.org/crons/index.html ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property |