0

I have code like this:

require_once 'Zend/Loader.php';
Zend_Loader::loadClass('Zend_Gdata');
Zend_Loader::loadClass('Zend_Gdata_Query');
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');

$user = 'usser';
$pass = 'pass';
$service = 'blogger';

$client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, $service, null,
        Zend_Gdata_ClientLogin::DEFAULT_SOURCE, null, null,
        Zend_Gdata_ClientLogin::CLIENTLOGIN_URI, 'GOOGLE');
$gdClient = new Zend_Gdata($client);

$blogID='someID';
$query = new Zend_Gdata_Query('http://www.blogger.com/feeds/' . $this->blogID . '/posts/default');

  $feed = $gdClient->getFeed($query);
  print $entry->title->text;

Problem is that i can print only few properties, like title and description. Any idea how to print other properties like id, url, author name, replies?

4

1 回答 1

2

我正在寻找相同的解决方案。原来所有的属性都存放在$object->property->text

因此,例如,如果您想获取消息 id,则必须这样做:

<?php
require_once 'Zend/Loader.php';
Zend_Loader::loadClass('Zend_Gdata');
Zend_Loader::loadClass('Zend_Gdata_Query');
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');

$user = 'usser';
$pass = 'pass';
$service = 'blogger';

$client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, $service, null,
        Zend_Gdata_ClientLogin::DEFAULT_SOURCE, null, null,
        Zend_Gdata_ClientLogin::CLIENTLOGIN_URI, 'GOOGLE');
$gdClient = new Zend_Gdata($client);

$blogID='someID';
$query = new Zend_Gdata_Query('http://www.blogger.com/feeds/' . $this->blogID . '/posts/default');

  $feed = $gdClient->getFeed($query);
// for all array witch properties print object $feed;
//print_r($feed);
  foreach ($feed as $feeds => $f){
  $idText = explode('-', $f->id->text);
  $postID = $idText[2];
  $title = $ou->title->text;

  }
于 2012-09-30T16:57:57.597 回答