I was trying to follow this answer:
https://stackoverflow.com/a/3331372/1063287
So in my php document I had the variables below:
$json = file_get_contents("https://gdata.youtube.com/feeds/api/videos/{$video_id}?v=2&alt=json");
$json_data = json_decode($json);
$video_title = $json_data->{'entry'}->{'title'};
$video_date = $json_data->{'entry'}->{'published'};
$video_duration = $json_data->{'entry'}->{'media:group'}->{'yt$duration'};
$video_views = $json_data->{'entry'}->{'yt$statistics'}->{'viewCount'};
$video_description = $json_data->{'entry'}->{'content'};
but that gave me the error:
Warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration in /home/path/to//file.php on line 12
Warning: file_get_contents(https://gdata.youtube.com/feeds/api/videos/xx-xxxxxxx?v=2&alt=json) [function.file-get-contents]: failed to open stream: no suitable wrapper could be found in /home/path/to/file.php on line 12
I have looked at the developers guide here:
https://developers.google.com/youtube/2.0/developers_guide_php
and can understand the feed and entry structure here:
and have found a few solutions (one involving curl) but they either haven't worked or I haven't known if they were the best method to use.
Can anyone please tell me if there is anything wrong in the above code?