데모
<?php
//ver1.0 150423 @_untitle_d
$yt_api = ''; //유튜브 API KEY, https://console.developers.google.com/project
function get_video_id($url){}
function youtube_info($id, $part='snippet')
{
global $yt_api;
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, "https://www.googleapis.com/youtube/v3/videos?id={$id}&key={$yt_api}&part={$part}");
curl_setopt($curl, CURLOPT_POST, 0);
curl_setopt($curl, CURLOPT_TIMEOUT, 10);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$return = curl_exec($curl);
curl_close($curl);
return json_decode($return, true);
}
$tmp_yt = 'http://www.youtube.com/watch?v=yEJ2-VofNCw'; //유튜브 동영상
$return = youtube_info(get_video_id($tmp_yt)); //유튜브 정보
echo "동영상 : ".$tmp_yt."<br>";
echo "제목 : ".$return['items'][0]['snippet']['title']."<br>"; //title
echo "채널명 : ".$return['items'][0]['snippet']['channelTitle']."<br>"; //channelTitle
echo "썸네일 : <img src='".$return['items'][0]['snippet']['thumbnails']['default']['url']."'><br>"; //thumb default
print_r($return);
?>
관련링크
http://untitled.untitle311apyxry1w48.com/lkbmgfh
참고
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 30 |
아우겐나이스
|
21년 전 | 4043 | |
| 29 |
아우겐나이스
|
21년 전 | 4433 | |
| 28 |
아우겐나이스
|
21년 전 | 3458 | |
| 27 | 21년 전 | 5822 | ||
| 26 | 21년 전 | 3094 | ||
| 25 | 21년 전 | 6071 | ||
| 24 | 18년 전 | 3643 | ||
| 23 | 21년 전 | 3630 | ||
| 22 | 21년 전 | 4241 | ||
| 21 | 21년 전 | 3814 | ||
| 20 | 21년 전 | 4214 | ||
| 19 | 21년 전 | 6677 | ||
| 18 | 21년 전 | 4732 | ||
| 17 | 21년 전 | 6982 | ||
| 16 | 21년 전 | 4165 | ||
| 15 | 21년 전 | 2625 | ||
| 14 | 21년 전 | 4965 | ||
| 13 | 21년 전 | 3396 | ||
| 12 |
Recluse
|
21년 전 | 3870 | |
| 11 |
아우겐나이스
|
21년 전 | 3566 | |
| 10 |
Recluse
|
21년 전 | 3390 | |
| 9 | 21년 전 | 3978 | ||
| 8 | 21년 전 | 5161 | ||
| 7 | 21년 전 | 4755 | ||
| 6 | 21년 전 | 5673 | ||
| 5 | 21년 전 | 4109 | ||
| 4 | 21년 전 | 4830 | ||
| 3 | 21년 전 | 4736 | ||
| 2 | 21년 전 | 3234 | ||
| 1 | 22년 전 | 4336 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기