$total_video = file_get_contents('https://gdata.youtube.com/feeds/api/users/id/uploads?v=2&alt=jsonc&max-results=0');
$total_video = json_decode($total_video);
$total_video_count = $total_video->data->totalItems;
$per_page = 10;
$last_page = floor($total_video_count / $per_page);
if(isset($_GET['youtube_page']) && $_GET['youtube_page']!=1 && $_GET['youtube_page']>1 && $_GET['youtube_page']<=$last_page){
$current_page = $_GET['youtube_page'];
$start_index = $per_page * $current_page + 1;
}else{
$current_page = 1;
$start_index = 1;
}
$user_id = '';
$feedURL = 'http://gdata.youtube.com/feeds/api/users/'.$user_id.'/uploads?max-results='.$per_page.'&start-index='.$start_index;
$sxml = simplexml_load_file($feedURL);
$i=0;
foreach ($sxml->entry as $entry) {
$media = $entry->children('media', true);
$watch = (string)$media->group->player->attributes()->url;
$thumbnail = (string)$media->group->thumbnail[0]->attributes()->url;
$video_embed = preg_match("!v=(.*)&feature=youtube_gdata_player!",$watch,$video_match);
$video_id = $video_match[1];
?>
}
$next_page = $current_page + 1;
if($current_page>1)
$prev_page = $current_page - 1;
else
$prev_page = 0;
?>
Api key aldım. Api keyi kod da nereye koymamız gerek acaba? Şimdiden teşekkürler..