Sign in to follow this  
Followers 0
serjiomati

помогите переделать

3 posts in this topic

помогите переделать скрипт с youtube api v2 в youtube api v3

public function getYouTubeVideo( $string ) {
if ( strtolower( $this->dle_config['charset'] ) != 'utf-8' ) $params = array( 'alt' => 'json', 'max-results' => '1', 'q' => iconv( $this->dle_config['charset'], 'utf-8', $string ) );
else $params = array( 'alt' => 'json', 'max-results' => '1', 'q' => $string );
$headers = array( 'X-GData-Key' => 'key=ключ', 'GData-Version' => '2' );
$this->curlQuery( 'http://gdata.youtube.com/feeds/api/videos' . $id, $params, 'GET', array( ), $headers, $response );
$object = json_decode( $response, true );
if ( ! empty( $object['feed']['entry'][0]['media$group']['yt$videoid']['$t'] ) ) return addslashes( trim( $object['feed']['entry'][0]['media$group']['yt$videoid']['$t'] ) );
return false;
}

 

Share this post


Link to post
Share on other sites

ап

Не обязательно так часто ап'ать тему. Это, как минимум, некрасиво. А как максимум - получите предупреждение со всеми вытекающими последствиями.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.