views:

592

answers:

2

I'm not good at programming and my trying to open one of my spreadsheet documents. Below in the basic login im using, I then request a list all my spreadsheet, which is returned in $feed.

And now I'm worried I'm not on the right track with opening a document so I can read and write cells.

<?php

require_once '../library/Zend/Loader.php';
Zend_Loader::loadClass('Zend_Gdata_Spreadsheets');
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
$user="username";
$pass="user password";

// login
$service = Zend_Gdata_Spreadsheets::AUTH_SERVICE_NAME;
$client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, $service);

$spreadsheetService = new Zend_Gdata_Spreadsheets($client);
$feed = $spreadsheetService->getSpreadsheetFeed();

print_r ($feed);
?>
A: 

You're on the right track. Are you using the information found http://framework.zend.com/manual/en/zend.gdata.spreadsheets.html ?

Your code is getting a spreadsheet feed which lists all the available spreadsheets, which is an important step. You'll want to follow the link above to get a list-based feed or a cell-based feed.

The documentation is pretty good I would recommend just reading through it all(yes it's long).

Kekoa
Thanks, I also found this today. http://blog.maartenballiauw.be/post/2009/02/03/Saving-a-PHPExcel-spreadsheet-to-Google-Documents.aspx So just need some time to try it all out.
+1  A: 

I forgot which social network my id was with, and so I have Activ8ed a new. A bit like a cylon.

I looked at the zend manual. I'm new to php so accessing Objects like $feed is still confusing. The Zend document needs to make better usage of http to expand the information present.

ie. the quote from zend manual

"Given the spreadsheet key from the of a Zend_Gdata_Spreadsheets_SpreadsheetEntry object you've already retrieved, you can fetch a feed containing a list of worksheets associated with that spreadsheet."

$feed returns Zend_Gdata_Spreadsheets_SpreadsheetEntry object

Ok so I've learned to display the files available with the code below.

foreach ($feed->entries as $entry) {
echo $entry->title->text .' '. $entry->content->text . "\n"; }

I think I'm starting to get it, but not sure what I should be reading.

http://framework.zend.com/apidoc/core/Zend_Gdata/Spreadsheets/Zend_Gdata_Spreadsheets.html Is making more scene too. But it's missing links to http://code.google.com/apis/spreadsheets/docs/2.0/developers_guide_protocol.html#ListingSpreadsheets which is the structure on $feed, well a pointer to a segment of one.

Trying more to Understanding how objects class's and functions are used in PHP. reading http://stackoverflow.com/questions/539677/class-variables-scope-resolution-operator-and-different-versions-of-php

http://stackoverflow.com/questions/32145/is-this-a-reasonable-way-to-handle-getters-setters-in-a-php-class

Did I mention this, http://code.google.com/apis/spreadsheets/docs/2.0/developers_guide_protocol.html#ListingSpreadsheets

http://zendguru.wordpress.com/2009/04/17/zend-framework-select-statement-and-where-clause-examples/

Hellonearthis