English 中文(简体)
利用Zend在YouTube上创建私人游戏名录
原标题:Create private playlist on YouTube using Zend

我急切地试图在你管上建立一个私人游戏牌。 创建公共游乐胜地是个问题,这并不好。 然而,Im无法“翻译” tocode。

You can use the API to update a playlist s title, description and or public/private status. To update a playlist, modify the PlaylistListEntry object for that playlist and then call the object s save method.

我的法典:

$httpClient = isset($_SESSION[ sessionToken ])? Zend_Gdata_AuthSub::getHttpClient($_SESSION[ sessionToken ]) : null;
$this->youtube = new Zend_Gdata_YouTube($httpClient, "CompanyName-AppName-0.1", null, $this->apikey);

// ...

$yt = $this->youtube;
$newPlaylist = $yt->newPlaylistListEntry();
$newPlaylist->description = $yt->newDescription()->setText( My Description );
$newPlaylist->title = $yt->newTitle()->setText( My Title );

$postLocation =  http://gdata.youtube.com/feeds/api/users/default/playlists ;
try {
    $yt->insertEntry($newPlaylist, $postLocation);
} catch (Zend_Gdata_App_Exception $e) {
    echo $e->getMessage();
}

最后一个部分是比较数字的样本代码。 它发挥了巨大作用,但运动员是公开的。

根据我的理解,$newPlaylist PlaylistListEn<>/code>,因此,应当采用一种方法使之为私人。 我检查了物体源代码(及其超过9000个母体物体)加上<编码>get_class_methods的产出,然而,我没有发现任何使该代码为私人的方法。 只是试图让私人/公共成员真实/虚假的 does,并导致错误的信息(即没有这样的成员)。

我对YouTube AP和Zend没有经历过,我非常赞赏有人能在这里帮助我。

从我看一看,可以添加一个<yt: private /> tag to the request。 这种声音很简单,是否可人工添加到请求中?

问题回答

I m not sur about playlist, but one particural video could be marked like a "private" in the moment of upload by:

$myVideoEntry = new Zend_Gdata_YouTube_VideoEntry();
$myVideoEntry->setMediaSource($filesource);
$myVideoEntry->setVideoTitle($video_title);
// ... etc ...
$myVideoEntry->setVideoPrivate();

我知道,你正在寻找游乐器,但也许可以帮助你......例如通过使这一方法的规范化等。





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签