reasonableframework/helper/api.whois.kr.php

33 lines
933 B
PHP
Raw Permalink Normal View History

2019-05-25 15:43:58 +00:00
<?php
/**
* @file api.whois.kr.php
* @date 2019-05-26
2022-11-25 14:15:20 +00:00
* @author Go Namhyeon <abuse@catswords.net>
2019-05-25 15:44:47 +00:00
* @brief KISA Whois/Domain/IP/AS Query Helper (https://whois.kr)
2019-05-25 15:43:58 +00:00
*/
if(!is_fn("get_whois_kr")) {
2019-05-25 15:43:58 +00:00
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,
2019-05-25 15:45:36 +00:00
"answer" => "json",
2019-05-25 15:43:58 +00:00
));
break;
case "ipascc":
$response = get_web_json("http://whois.kisa.or.kr/openapi/ipascc.jsp", "get.cache", array(
"query" => $name,
"key" => $key,
2019-05-25 15:45:36 +00:00
"answer" => "json",
2019-05-25 15:43:58 +00:00
));
break;
}
}
return $response;
}