Perform the following steps for listing YouTube videos for a keyword:
Create a function that will get the YouTube videos for the
Zend Framework
keyword.Establish the connection in a similar way to the previous connection made for Google Photos. This needs to be placed in a new method,
getYoutubeVideos()
, in theMediaManagerController
file,src/Users/Controller/MediaManagerController.php
:$adapter = new \Zend\Http\Client\Adapter\Curl(); $adapter->setOptions(array( 'curloptions' => array( CURLOPT_SSL_VERIFYPEER => false, ) )); $httpClient = new \ZendGData\HttpClient(); $httpClient->setAdapter($adapter); $client = \ZendGData\ClientLogin::getHttpClient( self::GOOGLE_USER_ID, self::GOOGLE_PASSWORD, \ZendGData\YouTube::AUTH_SERVICE_NAME, $httpClient);
Initialize the YouTube client and execute a video query for the keyword
Zend Framework
:$yt = new \ZendGData\YouTube($client); ...