【问题标题】:get albumid using album name OR get created album albumid from picasa in picasa-php-zend使用专辑名称获取专辑标识或从 picasa-php-zend 中的 picasa 获取创建的专辑专辑标识
【发布时间】:2014-08-29 17:33:35
【问题描述】:

我想获取已创建专辑的专辑 ID

$service = Zend_Gdata_Photos::AUTH_SERVICE_NAME;
$client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, $service);
$service = new Zend_Gdata_Photos($client);

$entry = new Zend_Gdata_Photos_AlbumEntry();
$entry->setTitle($service->newTitle("firstalbum"));

$values = $service->insertAlbumEntry($entry);
var_dump($values); ////display lots of no. of line of result with AlbumID,URL...

$values 返回很多行结果,它包含类似 ["位置"]=> 字符串(130) "https://picasaweb.google.com/data/entry/api/user/113978572163857330101/albumid/6050448340724330593/1?authkey=xxxxxxxxxxxxxxxxxxxxxxxx" 我想从中获取专辑 ID,但我不知道如何获取它。我试图获得“位置”,但没有成功。

【问题讨论】:

    标签: php zend-framework picasa


    【解决方案1】:

    我使用返回的 $values 对象获得了专辑 ID
    $value->getGphotoId();

    【讨论】:

      【解决方案2】:

      没有办法从 Zend_Gdata_Photos_AlbumEntry 获取 AlbumID,必须使用

      Zend_Gdata_Photos_PhotoEntry::getGphotoAlbumId()
      

      您可以在 Zend 和 Google 网站上找到示例: http://framework.zend.com/manual/1.12/en/zend.gdata.photos.html https://developers.google.com/picasa-web/docs/1.0/developers_guide_php#PhotosInfo

      好吧,你可以在专辑创建后检索专辑ID:

      $query = new Zend_Gdata_Photos_AlbumQuery();
      $query->setAlbumName('firstalbum');
      $albumEntry = $service->getAlbumEntry($query);
      $albumId = $albumEntry->getGphotoId()->getText();
      

      【讨论】:

      • 实际上我不知道如何从返回的 $values 对象中获取 ["Location"]。请帮我获取“位置”值。
      • 将答案更改为 ZF-way,但您已经在一分钟前找到了它)))
      猜你喜欢
      • 2015-05-23
      • 2011-09-30
      • 1970-01-01
      • 1970-01-01
      • 2011-11-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-12-26
      相关资源
      最近更新 更多