Create api.whois.kr.php

This commit is contained in:
Namhyeon Go 2019-05-26 00:43:58 +09:00 committed by GitHub
parent fcc1e1c4a0
commit 14644f9962
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

30
helper/api.whois.kr.php Normal file
View File

@ -0,0 +1,30 @@
<?php
/**
* @file api.whois.kr.php
* @date 2019-05-26
* @author Go Namhyeon <gnh1201@gmail.com>
* @brief KISA Whois/IP/AS Query Helper (https://whois.kr)
*/
if(!check_function_exists("get_whois_kr")) {
function get_whois_kr($name, $key, $type="whois") {
$response = false;
switch($type) {
case "whois":
$response = get_web_json("http://whois.kisa.or.kr/openapi/whois.jsp", "get.cache", array(
"query" => $name,
"key" => $key,
));
break;
case "ipascc":
$response = get_web_json("http://whois.kisa.or.kr/openapi/ipascc.jsp", "get.cache", array(
"query" => $name,
"key" => $key,
));
break;
}
}
return $response;
}