Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3637

"pretty printing" YouTube video description

$
0
0

i am getting youtube video description with

    apikey = 'KEY';    $googleApiUrl = 'https://www.googleapis.com/youtube/v3/videos?id=' . $videoId . '&key=' . $apikey . '&part=snippet';    $ch = curl_init();    curl_setopt($ch, CURLOPT_HEADER, 0);    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);    curl_setopt($ch, CURLOPT_URL, $googleApiUrl);    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);    curl_setopt($ch, CURLOPT_VERBOSE, 0);    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);    $response = curl_exec($ch);    curl_close($ch);    $data = json_decode($response);    $value = json_decode(json_encode($data), true);    $title = $value['items'][0]['snippet']['title'];    $description = $value['items'][0]['snippet']['description'];

is there any way to get just the "starting words" without that useless part as social links & donate etc? thanks guys


Viewing all articles
Browse latest Browse all 3637

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>