간단하게 사용하려면,
https://goo.gl/ 접속 후 입력하고 나면 원하는 웹페이지의 url을 입력하면 아래와 같이 링크 주소를 보여주는데
아래와 같이 알려준 주소를 사용하면 간단하네요

관리자페이지 하단에
아래와 같이 구글 짧은 주소 API key입력 하는 부분이 있구요.
버튼을 누르면 https://console.developers.google.com/apis/library API 라이브러리 페이지가 열립니다.
https://console.developers.google.com/apis/api/urlshortener/overview
구글 URL API이라고하는데요
<!--?php function get_shortURL($longURL) {
$api_key = "구글 API 키값";
$curlopt_url = "https://www.googleapis.com/urlshortener/v1/url?key=".$api_key;
$ch = curl_init();
//$timeout = 10;
curl_setopt($ch, CURLOPT_URL, $curlopt_url);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
//curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
$jsonArray = array('longUrl' =--> $longURL);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($jsonArray));
$shortURL = curl_exec($ch); curl_close($ch);
$result_array = json_decode($shortURL, true);
return $result_array['id']; // goo.gl
$shortURL = curl_exec($ch);
curl_close($ch);
return $shortURL;
}
?>
이걸 그누보드와 어떻게 연동해서 사용하는건지?
답변 2개
구글 단축 URL API 사용방법 (Javascript) :
https://goo.gl/hU42mG
답변을 작성하려면 로그인이 필요합니다.