구글 짧은 주소 API활용방법 문의드립니다. 채택완료
간단하게 사용하려면,
https://goo.gl/">https://goo.gl/ 접속 후 입력하고 나면 원하는 웹페이지의 url을 입력하면 아래와 같이 링크 주소를 보여주는데
아래와 같이 알려준 주소를 사용하면 간단하네요

관리자페이지 하단에
아래와 같이 구글 짧은 주소 API key입력 하는 부분이 있구요.
http://sir.kr/data/editor/1605/340a446f374175743aa895606ffaf0b3_1462315237_3067.png" title="340a446f374175743aa895606ffaf0b3_1462315237_3067.png">
버튼을 누르면 https://console.developers.google.com/apis/library">https://console.developers.google.com/apis/library API 라이브러리 페이지가 열립니다.
https://console.developers.google.com/apis/api/urlshortener/overview">https://console.developers.google.com/apis/api/urlshortener/overview
구글 URL API이라고하는데요
</pre><pre style="line-height: normal;"><span style="font-family: 돋움; font-size: 14.6667px; white-space: normal;"><!--?php </span> </pre><pre style="line-height: normal;">function get_shortURL($longURL) { $api_key = "구글 API 키값"; $curlopt_url = "<a href="https://www.googleapis.com/urlshortener/v1/url?key=" target="_blank" rel="noopener noreferrer">https://www.googleapis.com/urlshortener/v1/url?key=</a>".$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; } ?></pre><p style="font-size: 14.6667px;">
이걸 그누보드와 어떻게 연동해서 사용하는건지?
답변 2개
구글 단축 URL API 사용방법 (Javascript) :
https://goo.gl/hU42mG">https://goo.gl/hU42mG
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인